3 ms·
How can the benchmark show Mongita be around as fast as SQLite if SQLite is written in C and Mongita in Python? Genuine question!
by axiosgunnar 6y ago
How can the benchmark show Mongita be around as fast as SQLite if SQLite is written in C and Mongita in Python?
Genuine question!
- scottrogowski 6y agoIt's a good question and to be accurate, depending on the benchmark, Mongita is about the same speed at SQLite to several-times slower. There is less happening algorithmically than you would think. Where the tricky slow bits do exist, they have largely fallen into the happy-path of fast data structures in the Python language/stdlib. I also use sortedcontainers for indexes which helped quite a bit (http://www.grantjenks.com/docs/sortedcontainers/ http://www.grantjenks.com/docs/sortedcontainers/). If you're curious, the benchmark code is in the repo: https://github.com/scottrogowski/mongita/blob/master/benchmark_tests/benchmark.py https://github.com/scottrogowski/mongita/blob/master/benchma...