阅读背景:

每次重新加载python模块时如何避免计算

来源:互联网 

I have a python module that makes use of a huge dictionary global variable, currently I put the computation code in the top section, every first time import or reload of the module takes more then one minute which is totally unacceptable. How can I save the computation result somewhere so that the next import/reload doesn't have to compute it? I tried cPickle, but loading the dictionary variable from a file(1.3M) takes approximately the same time as computation.I have a python module that makes use of a huge




你的当前访问异常,请进行认证后继续阅读剩余内容。

分享到: