Antoine Pitrou <pit...@free.fr> added the comment:

> "In CPython, json.dumps(o), by itself, is faster than json.dump(o,f),
> at the expense of using more space, because it creates the entire
> string at once, instead of incrementally writing each piece of o to f.
> However, f.write(json.dumps(o)) may not be faster."

Uh, talking about "CPython" is not very helpful here and only muddies
the waters IMO.
Something like "typical implementations of dump() will try to write the
result in small chunks and will therefore trade lower memory usage for
higher serialization time. If you have enough memory and care about
performance, consider using dumps() and write the result yourself with a
single write() call".

----------

_______________________________________
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue12134>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to