Issue1754225

classification
Title: str(really_huge_long_value) takes an incredibly long time
Type: Severity: normal
Components: None Versions:
Milestone:
process
Status: closed Resolution: wont fix
Dependencies: Superseder:
Assigned To: Nosy List: bobocopy, cgroves, zyasoft
Priority: normal Keywords:

Created on 2007-07-15.07:13:51 by cgroves, last changed 2008-09-14.00:15:34 by zyasoft.

Messages
msg1717 (view) Author: Charlie Groves (cgroves) Date: 2007-07-15.07:13:51
muhngole yohoho $ jy2.3 
Jython 2.3a0 on java1.5.0_07
Type "copyright", "credits" or "license" for more information.
>>> nbase = long("deadbeeffeedface", 16)
>>> nbase += nbase << 1000000
>>> nbase

causes jython to peg the cpu for quite a while on my system.  Lib/test/pickletester.py uses that value to dump and load to test really big longs, and cpickle and pickle both use str to dump it which causes the pickle tests to take ages(I actually haven't seen them complete).
msg1718 (view) Author: bobocopy (bobocopy) Date: 2007-09-14.22:56:46
This behavior isn't Jython-specific.  I get the same CPU spike and hang time when interpreting the same code snippet in Python 2.4 (using IDLE) and Python 2.5.1 (running in Cygwin).  
msg3560 (view) Author: Jim Baker (zyasoft) Date: 2008-09-14.00:15:34
As bobocopy notes, this stringification takes some time on both CPython
and Jython, about 50 seconds for both on my MacBook Pro.

However, we no longer have issues in test_pickle (~8s), test_cpickle
(~4s), not factoring out JVM startup times, so this is not an issue.
History
Date User Action Args
2008-09-14 00:15:34zyasoftsetstatus: open -> closed
nosy: + zyasoft
resolution: wont fix
messages: + msg3560
2007-07-15 07:13:51cgrovescreate