Loading a large dictionary using python pickle

后端 未结 5 1516
[愿得一人]
[愿得一人] 2020-12-15 09:41

I have a full inverted index in form of nested python dictionary. Its structure is :

{word : { doc_name : [location_list] } }

For example l

5条回答
  •  夕颜
    夕颜 (楼主)
    2020-12-15 10:04

    Dependend on how long is 'long' you have to think about the trade-offs you have to make: either have all data ready in memory after (long) startup, or load only partial data (then you need to split up the date in multiple files or use SQLite or something like this). I doubt that loading all data upfront from e.g. sqlite into a dictionary will bring any improvement.

提交回复
热议问题