WiseLibs / better-sqlite3

The fastest and simplest library for SQLite3 in Node.js.
MIT License
5.23k stars 390 forks source link

Performance numbers might not be representitive or are outdated #1120

Open tobyhinloopen opened 6 months ago

tobyhinloopen commented 6 months ago

https://github.com/WiseLibs/better-sqlite3/blob/HEAD/docs/benchmark.md

The performance difference measured on my machine is much greater!

hinloopen@7950X:~/Projects/better-sqlite3$ node benchmark/
--- reading rows individually ---
better-sqlite3 x 597,935 ops/sec ±0.21%
node-sqlite3   x 9,086 ops/sec ±0.27%

--- reading 100 rows into an array ---
better-sqlite3 x 17,584 ops/sec ±0.19%
node-sqlite3   x 4,493 ops/sec ±0.3%

--- iterating over 100 rows ---
better-sqlite3 x 15,393 ops/sec ±0.14%
node-sqlite3   x 95 ops/sec ±0.59%

--- inserting rows individually ---
better-sqlite3 x 56,636 ops/sec ±9.38%
node-sqlite3   x 9,711 ops/sec ±4.01%

--- inserting 100 rows in a single transaction ---
better-sqlite3 x 6,715 ops/sec ±6.82%
node-sqlite3   x 54 ops/sec ±4.77%

All benchmarks complete!
hinloopen@7950X:~/Projects/better-sqlite3$ node --version
v20.10.0

7950X 64GB RAM 2TB 980 Pro SSD Node 20.10.0node Ubuntu 22 in WSL Win 11

I'm sorry for the bad title - I just wanted to share this 🙃

JoshuaWise commented 3 months ago

Hooray!

melroy89 commented 2 months ago

Maybe create a pr with your latest results? Since the current results are from 2020.

houd1ni commented 2 months ago

@JoshuaWise

--- iterating over 100 rows ---
better-sqlite3 x 15,393 ops/sec ±0.14%
node-sqlite3   x 95 ops/sec ±0.59%

Why ?

melroy89 commented 2 months ago

better-sqlite3 x 15,393 ops/sec ±0.14% node-sqlite3 x 95 ops/sec ±0.59%

If that is true, this is a 162 times improvement 😮 . But yea, plz update the benchmark results anyway.