Skip to content

Tags: zhangyunhao116/skipmap

Tags

v0.10.1

Toggle v0.10.1's commit message

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
LoadOrStore: generate the level lazily (#10)

The key problem is that `LoadOrStore` uses an outdated highest level to search the skip list, if the new generated level(says `newLevel`) is bigger than the outdated highest level(says `oldLevel`), all slots in the slices `preds[newLevel-oldLevel:newLevel]` are nil, the function will panic.

The solution is that if the `newLevel` has updated the highest level, we could just continue the loop, and find a new path. At this time, the latest highest level used by the `findNode` is always bigger than or equal to the newLevel, the function won't panic.

name                            old time/op  new time/op  delta
LoadOrStoreExist-16             4.43ns ±11%  1.06ns ±21%  -76.05%  (p=0.000 n=10+10)
LoadOrStoreLazyExist-16         4.61ns ± 6%  1.16ns ± 0%  -74.90%  (p=0.000 n=9+7)
LoadOrStoreExistSingle-16       37.5ns ± 6%  10.3ns ± 0%  -72.61%  (p=0.000 n=9+9)
LoadOrStoreLazyExistSingle-16   38.3ns ±11%  10.6ns ± 0%  -72.43%  (p=0.000 n=10+10)
LoadOrStoreRandom-16             209ns ±14%   206ns ±14%     ~     (p=0.684 n=10+10)
LoadOrStoreLazyRandom-16         215ns ± 8%   207ns ± 9%     ~     (p=0.139 n=10+10)
LoadOrStoreRandomSingle-16      1.05µs ± 1%  1.04µs ± 4%     ~     (p=0.535 n=9+10)
LoadOrStoreLazyRandomSingle-16  1.07µs ± 1%  1.06µs ± 3%   -1.09%  (p=0.029 n=8+9)

v0.10.0

Toggle v0.10.0's commit message
fix: fix float map bad cases

v0.9.1

Toggle v0.9.1's commit message
fix: NewFunc support any types

v0.9.0

Toggle v0.9.0's commit message
feat: generic key and value

v0.8.0

Toggle v0.8.0's commit message

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
feat: update APIs for generics (>= go1.18) (#4)

v0.7.0

Toggle v0.7.0's commit message
feat: add LoadOrStoreLazy

v0.6.0

Toggle v0.6.0's commit message

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
feat: support optional array (#3)

v0.5.2

Toggle v0.5.2's commit message

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
fix LoadOrStore overwrite (#2)

v0.5.1

Toggle v0.5.1's commit message
refactor code generator

v0.5.0

Toggle v0.5.0's commit message
update readme