3 ms·
I had a situation with HashBackup (I'm the author) where I needed a map-like data structure that could get rather large (hundreds of MB to a few GB) with big ba
by prirun 2y ago
I had a situation with HashBackup (I'm the author) where I needed a map-like data structure that could get rather large (hundreds of MB to a few GB) with big backups. In Python, storing this data in a dict was not really feasible because every unique integer takes 24 bytes, and since the data structure stores things like blockid and file offsets, there are a lot of unique integers.
Instead, I created an in-memory SQLite database for the data structure and it was something like 1/3 the size of the Python dict. It was around 10-15% slower, but for the memory savings it was an okay trade-off.