How can I speed up unpickling large objects if I have plenty of RAM?

前端 未结 8 882
别那么骄傲
别那么骄傲 2020-12-09 09:07

It\'s taking me up to an hour to read a 1-gigabyte NetworkX graph data structure using cPickle (its 1-GB when stored on disk as a binary pickle file).

Note that the

8条回答
  •  小蘑菇
    小蘑菇 (楼主)
    2020-12-09 09:29

    why don't you use pickle.load?

    f = open('fname', 'rb')
    graph = pickle.load(f)
    

提交回复
热议问题