rustq / colorid-wasm

The unique 4-colors-ID string generator in WASM
MIT License
122 stars 2 forks source link

Add "@lukeed/uuid" to benchmark #10

Closed hyrious closed 1 year ago

hyrious commented 2 years ago

@lukeed/uuid

The uuid package is known to be slow, I want to add another fine-tuned uuid_v4 library. Here is the benchmark result on my machine.

crypto.randomUUID   10,251,962 ops/sec
colorid              3,399,498 ops/sec
nanoid               3,221,264 ops/sec
uuid v4              1,043,354 ops/sec
lukeed uuid v4       4,047,917 ops/sec
> envinfo --system
OS: macOS 12.6
CPU: (8) x64 Intel(R) Core(TM) i5-8257U CPU @ 1.40GHz
Memory: 146.19 MB / 8.00 GB
Shell: 5.8.1 - /bin/zsh
Node.js: 18.9.0
Y80 commented 2 years ago

hahah 砸场的来了

meloalright commented 1 year ago

@lukeed/uuid 很不错 好消息是这个库的性能在 nanoid 的官方 benchmark 有一个很不错的对比: nanoid#benchmar

colorid 这里因为实际上原理和 uuid 无太大差别 性能很重要但不是关键 没有再放更多的社区库对比

不过实际上在隔壁也有个 napi-nanoid 做了更多社区库对比 因为引入 rust 的原因 它是个更加关注性能提升的库: napi-nanoid#performance