speedb-io / speedb

A RocksDB compliant high performance scalable embedded key-value store
https://www.speedb.io/
Apache License 2.0
857 stars 63 forks source link

db_bench: optimize Done, replace slow divisions with addition/subtrac… #861

Open ColinIanKing opened 1 month ago

ColinIanKing commented 1 month ago

…tions

There are two slow 64 bit division operations that are computationally quite expensive. Replace these with a modulo style counter that uses simpler and faster increment, comparision and subtraction operations. On a 60 second run, this optimization reduced the function CPU utilization from 21.8 seconds down to 2.3 seconds on an i7-6700 as measured using Intel vtune.

ofriedma commented 2 weeks ago

@ColinIanKing please add a record to HISTORY.md