Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

How can the benchmark show Mongita be around as fast as SQLite if SQLite is written in C and Mongita in Python?

Genuine question!



It'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/).

If you're curious, the benchmark code is in the repo: https://github.com/scottrogowski/mongita/blob/master/benchma...




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: