Closed KodrAus closed 4 months ago
We previously would take the global lock when getting the number of bits the counter occupies in Uuid::now_v7(), despite this value being a constant.
Uuid::now_v7()
As expected, it does reduce the cost of Uuid::now_v7(). On my M1 MacBook Pro:
Before:
test now_v7 ... bench: 61.51 ns/iter (+/- 0.83)
After:
test now_v7 ... bench: 55.67 ns/iter (+/- 2.43)
We previously would take the global lock when getting the number of bits the counter occupies in
Uuid::now_v7()
, despite this value being a constant.As expected, it does reduce the cost of
Uuid::now_v7()
. On my M1 MacBook Pro:Before:
After: