-
Notifications
You must be signed in to change notification settings - Fork 0
Home
Above is a diagram showing how writes are handled in nahcrofDB. There will be tests shown below using tests.py to display the speed.
Server Specs:
CPU: Intel(R) Core(TM) i3-10110U
RAM: 8GB DDR4
HDD: WDC WD10SPZX-08Z
making 100 keys in an empty database folder (single thread)
time: 5.602836608886719e-05s
speed: 1,784,810.21 keys/second
keys queued: 100
Searching Names starting with test (will return all keynames)
--searchnames (test, start) time: 0.017322301864624023
--searchnames (test, start) values returned: 100
making 100,000 keys in an empty database folder (single thread)
time: 0.12023043632507324s
speed: 831736.1481549051/s
keys queued: 100000
Searching Names starting with test (will return all keynames)
--searchnames (test, start) time: 0.10810136795043945
--searchnames (test, start) values returned: 100000
making 1,000,000 keys in an empty database folder (single thread)
time: 2.2465384006500244s
speed: 445129.27075301943/s
keys queued: 1000000
Searching Names starting with test (will return all keynames)
--searchnames (test, start) time: 0.977008581161499
--searchnames (test, start) values returned: 1000000
While the search times definitely show a need for search optimization, overall, the database is pretty sound. Writing to the database is incredibly scalable and just a reminder, these tests are ran on a single thread, the database will typically run writes asynchronously, meaning it's possible that more writes could be handled. To add a little bit of clarity, the average key-size made during the test is 216 bytes. The final size of the 1,000,000 key database was 65.45MB. nahcrofDB took ~1.5s to build structures upon starting with a 1,000,000 key database (meaning it took 1.5s to load the structure file into memory).