New submission from INADA Naoki:

When I run following script:

def uncalled():
    x = b'x' * (2**32)
print('Hello')

Python 3.4 consumes huge memory in spite of uncalled() function isn't called.

$ /usr/bin/time  -l /usr/local/bin/python2 constant_folding.py
Hello
        0.02 real         0.01 user         0.00 sys
   4337664  maximum resident set size

$ /usr/bin/time  -l /usr/local/bin/python3 constant_folding.py
Hello
        2.76 real         1.36 user         1.39 sys
4300234752  maximum resident set size

Both of Python 2.7.6 and Python 3.4.0 is built with Homebrew.

----------
components: Interpreter Core
messages: 214928
nosy: naoki
priority: normal
severity: normal
status: open
title: Too aggressive constant folding
type: resource usage
versions: Python 3.4

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

Reply via email to