Charles-François Natali <neolo...@free.fr> added the comment:

There's been some work done on the GC some time ago to address this type of 
pattern (I think to reduce from quadratic complexity to amortized linear 
complexity). I'm adding Antoine and Martin who were involved in this.

> Here is a short python script that demonstrates the issue, the JSON
> file in this case is 1.2GB large:

A couple remarks:
- please indicate the Python version you're using
- you should put your test in a script, one with gc.disable() at the top, to 
avoid using any cache that might be used internally by cjson
- you should perform "echo 3 > /proc/sys/vm/drop_cache" before each run to make 
sure you start with a cold page/buffer cache (see how fast your file got read 
the second time you called read_json_blob()?)

----------
nosy: +loewis, neologix, pitrou

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

Reply via email to