3 ms·
Every time I've found myself heading down this rabbit hole of creating a faster Python list sort/search, I've inevitably realized that using an in-memory sqlite
by bshipp 4y ago
Every time I've found myself heading down this rabbit hole of creating a faster Python list sort/search, I've inevitably realized that using an in-memory sqlite database is orders of magnitude faster and more flexible, especially once you start trying to mangle lists or sets with millions of elements.
The added benefit is that you can also dump it to the drive if you have to prematurely end your task and resume it from the same place later. And it also supports indexes, both traditional and full-text searching.
It's a lot easier to use a tool designed for the task instead of building one from scratch.