Issue124

Title String concatenation Performance
Priority bug Status chatting
Superseder Nosy List jiamo, kayhayen
Assigned To kayhayen Keywords optimization

Created on 2014-03-07.15:27:44 by jiamo, last changed by kayhayen.

Messages
msg1598 (view) Author: kayhayen Date: 2015-09-30.07:27:06
The speed-up for in-place float operation += is 2.5 fold to previous Nuitka and 3 
fold to CPython now. I am adding support for more operations, e.g *= is now on 
factory, and /* should follow suit.
msg1588 (view) Author: kayhayen Date: 2015-09-29.07:14:48
On factory there is code to speed up in place add of floats. Many more operations 
could be done that way. Seems significantly faster. Graphs need to be updated, 
but that's bound to happen during the day.
msg1582 (view) Author: kayhayen Date: 2015-09-26.11:01:15
I have added construct tests that show that the other types are at least not 
worse, now checking out, if float in-place operation can be detected and made 
faster.
msg991 (view) Author: kayhayen Date: 2015-03-08.20:04:52
Part of the current release. Still investigating if other operations can also be 
made in-place operations.
msg968 (view) Author: kayhayen Date: 2015-02-20.08:22:54
For 0.5.10 there is going to be something. Current factory branch holds 
improvements for local variables in-place operations. These will need to be 
expanded.

This became possible, as the C++ classes are no more. Unfortunately, getting all 
of this right, may have span across multiple releases. My goal is to get it 
right for the "a = a + b" as well as for the "a += b" case, which now works.
msg756 (view) Author: kayhayen Date: 2014-08-11.08:11:23
Still no fix in 0.5.4 for this. The intent is to first get SSA into good shape 
before coming to this. At this time, there are still some C++ classes in use for 
local variables, and I don't want to solve this with that kind of code generation.
msg693 (view) Author: kayhayen Date: 2014-06-23.07:47:05
Sorry, but 0.5.2 doesn't have a fix for this critical bug, but it remains a top 
priority.

Basically, with the many code generation related changes, I didn't want to delay 
it due to corruption risks coming from this change. Ought to be part of the next 
release therefore.
msg569 (view) Author: kayhayen Date: 2014-03-07.16:40:36
This is actually the worst issue in my mind there currently is with Nuitka.

As I said, C-ish code generation will solve this. I have attempted to create markup for 
code generation, and in fact code that actually performed well, but I just found it too 
difficult, to make handle this with the current "C++ish" code generation.

Unfortunately that means, I won't have a solution as fast as I normally would like to 
have it. Instead this will require C-ish to finish, which well may be at least one month 
more. We shall see.
msg568 (view) Author: jiamo Date: 2014-03-07.15:27:44
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)
History
Date User Action Args
2015-09-30 07:27:06kayhayensetmessages: + msg1598
2015-09-29 07:14:48kayhayensetmessages: + msg1588
2015-09-26 11:01:15kayhayensetstatus: done-cbb -> chatting
messages: + msg1582
2015-03-14 14:46:27kayhayensetstatus: testing -> done-cbb
2015-03-08 20:04:52kayhayensetmessages: + msg991
2015-03-08 20:04:23kayhayensetstatus: in-progress -> testing
priority: critical -> bug
2015-02-20 08:22:54kayhayensetmessages: + msg968
2014-08-11 08:11:23kayhayensetmessages: + msg756
2014-06-23 07:47:05kayhayensetmessages: + msg693
2014-03-07 16:40:36kayhayensetstatus: unread -> in-progress
priority: bug -> critical
messages: + msg569
2014-03-07 15:29:31jiamosetstatus: deferred -> unread
2014-03-07 15:28:23jiamosetpriority: urgent -> bug
2014-03-07 15:27:44jiamocreate