Closed Valerionn closed 2 years ago
Name | Link |
---|---|
Latest commit | 3cfd2cdf6c72bd69a22428f6ea3eb8b54b774837 |
Latest deploy log | https://app.netlify.com/sites/blinkdb/deploys/6320af1330a6f900090b0cec |
Thanks for creating a new benchmark - I'll eventually remove these files altogether, and build some benchmarks right into the docs so I can
Not specific to your PR, but I noticed that it would probably be a good idea to throw errors if the DB reaches an inconsistent state (for example if an item is present in the primary btree, but not in other indexes). Performance wise, branch prediction will take care of it, and user wise
clone
set to false
get feedback as well.
I have changed some create/remove operations to now edit the array in-memory instead of allocating a new array which should be a lot faster:
This should not change the behavior in any observable way (unless an index array contains the same item multiple times, which should not happen as far as I know) but provides a significant performance boost especially when inserting entries.
I added some benchmarks below, using a table with 1 index. However, the performance increase is even bigger when using multiple indexes (e.g. creating 10.000 items with 5 indexes takes 40ms now instead of 78ms, using clone in both cases).
Additionally, I fixed a small bug in the remove implementation that I stumbled upon.
Create 10.000 items:
Before
After
Update one item:
Before
After
Remove one item:
Before
No before available due to a bug in the current implementation which leads to faster execution time (but a wrong result)
After