I have a 2gb text file for filtering out values used by a python program i access infrequently. I do this by loading every line into a set and doing fast contains checks. This was a good idea at first when the file was only a few megabytes in size, but after a year the file has grown, and the initial loading time has become unmanageable even though i have basically unlimited RAM.
Before i replace my existing code with a file-based binary search, i wanted to ask if there's any way to use set functionality directly as a file on disk? I know there are tools to store data structures and load them into memory, but the loading part is the problem here.
sqlite3would work, and it comes with Python out of the box so no external dependencies.