2013/7/18 Eleytherios Stamatogiannakis <[email protected]>

> Why is there such a huge speed difference between cPickle.dump( ... f) and
> f.write(cPickle.dumps(...)) ?


Did you count the number of calls to f.write?
pickle call write() once per pickled object.

Now, pypy's implementation of buffered file uses a (RPython) list of
strings, and does a final ''.join.
This is probably much less efficient than the RStringIO implementation.

-- 
Amaury Forgeot d'Arc
_______________________________________________
pypy-dev mailing list
[email protected]
http://mail.python.org/mailman/listinfo/pypy-dev

Reply via email to