]> git.ozlabs.org Git - ccan/commit - ccan/tdb2/private.h
tdb2: use expansion heuristics from tdb1
authorRusty Russell <rusty@rustcorp.com.au>
Mon, 22 Nov 2010 01:20:58 +0000 (11:50 +1030)
committerRusty Russell <rusty@rustcorp.com.au>
Mon, 22 Nov 2010 01:20:58 +0000 (11:50 +1030)
commit20defbbcfa088a7574d9897b533d1bc600b2df53
tree8f865682c991a37a4b99e72b9ea9df488932ce5f
parent5e30abc662990449444769c71cf98ca788db4117
tdb2: use expansion heuristics from tdb1

This reduces the amount of expansion we do.

Before:
./speed 1000000
Adding 1000000 records:  23210 ns (59193360 bytes)
Finding 1000000 records:  2387 ns (59193360 bytes)
Traversing 1000000 records:  2150 ns (59193360 bytes)
Deleting 1000000 records:  13392 ns (59193360 bytes)
Re-adding 1000000 records:  11546 ns (59193360 bytes)
Appending 1000000 records:  29327 ns (91193360 bytes)
Churning 1000000 records:  33026 ns (91193360 bytes)

After:
$ ./speed 1000000
Adding 1000000 records:  17480 ns (61472904 bytes)
Finding 1000000 records:  2431 ns (61472904 bytes)
Traversing 1000000 records:  2194 ns (61472904 bytes)
Deleting 1000000 records:  10948 ns (61472904 bytes)
Re-adding 1000000 records:  11247 ns (61472904 bytes)
Appending 1000000 records:  21826 ns (96051424 bytes)
Churning 1000000 records:  27242 ns (96051424 bytes)
ccan/tdb2/free.c
ccan/tdb2/private.h