Already send it to maillist, here can be good for you to track.
I found a re String concatenation Performance problem the use nuitka
here is the testcase .
----------------------------------------
testtes.py
str=["aaaaaraaaaaa@@plt","tetst","testttesttesttestttesttest","testplt",
"aaaaaaaaataaplt","t","testtesttetstttesttesttest","testplt"]
testnum = 0
answerstr = ""
for i in range(1,1000):
for j in range(1,1000):
for one in str:
if one.endswith("@plt"):
answerstr+=one
testnum +=1
print testnum,"end"
-------------------------------------------
#time python testtest.py
998001 end
real 0m3.310s
user 0m3.220s
sys 0m0.028s
#time ./testtest.exe
take two much time and i don't know how long it need
here i change the examle to impove it
---------------------------------------------
str=["aaaaaraaaaaa@@plt","tetst","testttesttesttestttesttest","testplt",
"aaaaaaaaataaplt","t","testtesttetstttesttesttest","testplt"]
testnum = 0
answerstr = ""
for i in range(1,1000):
tmpstr2 = ""
for j in range(1,1000):
tmpstr=""
for one in str:
if one.endswith("@plt"):
tmpstr+=one
testnum +=1
tmpstr2+=tmpstr
answerstr += tmpstr2
print testnum,"end"
---------------------------------------------------------
time python testtest.py
998001 end
real 0m3.548s
user 0m3.472s
sys 0m0.024s
time ./testtest.exe
998001 end
real 0m17.946s
user 0m11.241s
sys 0m6.560s
(this time it can be finish , however is is slow than python)
|