I have a 1.5GB size dictionary
that it takes about 90 seconds to calculate so I want to save it once to storage and load it every time I want to use it again. This creates two challenges:
- Loading the file has to take less than 90 seconds.
- As RAM is limited (in pycharm) at ~4GB it cannot be memory-intensive.
I also need it to be utf-8
capable.
I have tried solutions such as pickle
but they always end up throwing a Memory Error
.
Notice that my dictionary is made of Strings and thus solutions like in this post do not apply.
Things I do not care about:
- Saving time (as long as it's not more than ~20 minutes, as I'm looking to do it once).
- How much space it takes in storage to save the dictionary.
How can I do that? thanks
Edit:
I forgot to mention it's a dictionary containing sets, so json.dump()
doesn't work as it can't handle sets.