perf(id): optimize snowflake to beat Myrra (364→<280 ns/op) #39

Closed
opened 2026-02-20 08:44:49 +00:00 by ash · 1 comment
Owner

Myrra: 283 ns/op. eskit: 364 ns/op. 23% slower.

Investigate: cached timestamp, batched sequence, avoid time.Now() syscall per call.

Target: <280 ns/op. Benchmark before/after.

Myrra: 283 ns/op. eskit: 364 ns/op. 23% slower. Investigate: cached timestamp, batched sequence, avoid time.Now() syscall per call. Target: <280 ns/op. Benchmark before/after.
Author
Owner

Closing. 81ns difference is irrelevant when DB round-trip is 1ms+. Vanity optimization.

Closing. 81ns difference is irrelevant when DB round-trip is 1ms+. Vanity optimization.
ash closed this issue 2026-02-20 08:45:47 +00:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
ash/eskit#39
No description provided.