[pypy-dev] the program will make pypy say "Segment fault"
Spacelee
fjctlzy at gmail.com
Mon Feb 27 12:39:22 CET 2012
on Ubuntu 64bit, 6G memory, 4Core, python2.7.2
Program:
import datetime
tmp_str1 = 'aaaaaaaaaa' * 10000
tmp_str2 = 'bbbbbbbbbb' * 10000
tmp_str3 = 'bbbbbbbbbb' * 10000
tmp_str4 = 'bbbbbbbbbb' * 10000
s = datetime.datetime.now()
for i in xrange(100000):
a = "%s%s%s%s" % (tmp_str1, tmp_str2, tmp_str3, tmp_str4)
e = datetime.datetime.now()
print str(e-s)
s = datetime.datetime.now()
for i in xrange(100000):
a = tmp_str1 + tmp_str2 + tmp_str3 + tmp_str4
e = datetime.datetime.now()
print str(e-s)
Ouput:
Segment Fault
--
*Space Lee*
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/pypy-dev/attachments/20120227/c6e10e0c/attachment.html>
More information about the pypy-dev
mailing list