[Python-Dev] Re: [Python-checkins] python/nondist/sandbox/spambayes GBayes.py,1.7,1.8

Skip Montanaro skip@pobox.com
Thu, 22 Aug 2002 11:33:25 -0500

    Charles> So the big question is, why is my naive "o = __import__ (f, {},
    Charles> {}, [])" so much faster than the more obvious "o = cPickle.load
    Charles> (f)"?  And what can I do to make it faster :).

Try dumping in the binary format, e.g.:

    s = cPickle.dumps(obj, 1)