A. Skrobov added the comment:

The attached patch for the parser reduces "Maximum resident set size (kbytes)" 
threefold, for the degenerate example of 'import ast; ast.parse("0,"*1000000, 
mode="eval")', by eliminating many CST nodes that have a single child.

According to the comment in node.c -- "89% of PyObject_REALLOC calls in 
PyNode_AddChild passed 1 for the size" -- the memory saving should be generally 
applicable, and not limited just to this degenerate case.

Modules/parsermodule.c is not yet updated to match. Please tell if you want me 
to do that, in case that my proposed change to the parser is acceptable.

----------
Added file: http://bugs.python.org/file42101/patch

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

Reply via email to