Slowdown when putting symbols into image data

William Prothero prothero at earthednet.org
Wed Sep 10 23:49:16 EDT 2014


Alex:
In my code, the offending statement is:
    put byte 1 to tLength of tbrushBinaryData into byte tNewStart * 4 - 3 to tNewStart*4 - 3  + tLength -1 of imgdata  -- insert brushimageData into image imageData

Is there anything you can see in this line, relevant to the speedup modification you have?
Bill

> Thing is, I wasn't trying to benchmark strings, I was trying to benchmark byte operations :-)
> 
> I thought that by using "byte X to Y of ..." that I was using "just" bytes, not strings - and therefore not Unicode.
> 
> But Ali has already produced a fix giving significant speed-up (!!) and in his explanatory comment in the bug report he describes how my test code required a type conversion on each assignment (because I was inadvertantly making the variable be a character string to start with). So his fix gives a big improvement - and then (using a simple script change in the test example) he can gain another 40% improvement.
> 
> I am absolutely blown away by this responsiveness !!
> 
> Unfortunately, until his fix is included (due to be in the next build), his suggested script change doesn't help - so I'm not able to do any further (useful) testing on this part of performance. It looks like between his code change plus his suggested script change, the performance hit reduces to a mere 7X - still (IMHO) a pretty high number, but hopefully good enough that we can live with the performance impact for now.
> 
> I'll re-test once RC2 comes out, and in the meantime I think I should play around with some more performance testing of other areas of the code.
> 
> -- Alex.
> P.S. Thanks again to Ali - I can hardly believe this level of responsiveness.
> 
> _______________________________________________
> use-livecode mailing list
> use-livecode at lists.runrev.com
> Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
> http://lists.runrev.com/mailman/listinfo/use-livecode





More information about the use-livecode mailing list