[Laszlo-dev] A major performance problem with sendBehind
Sarah Allen
sallen at laszlosystems.com
Fri Jun 10 03:59:54 PDT 2005
The sendBehind call is definitely slow. You should just create the text
views in the order you want them to be.
Sarah
Asger Alstrup wrote:
> Hi,
>
> The attached program becomes slower and slower when you click on it.
> If you uncomment the sendBehind call, things are fine.
>
> Any ideas for how to solve this?
>
> Regards,
> Asger Ottar Alstrup
>
>------------------------------------------------------------------------
>
><canvas height="80%" width="100%">
> <view width="100%" height="100%">
> <method event="oninit">
> build();
> </method>
>
> <method name="build"><![CDATA[
> var start = (new Date).getTime();
> this.v = new Array();
> for (var i = 0; i < 100; ++i) {
> var topic = new LzText(this, {
> x: Math.floor(i / 10) * 30,
> y: (i % 10) * 10 + 150,
> text: i } );
> this.v[i] = topic;
>
> if (i > 0) {
> // This slows following refreshes down tremendously:
> this.v[i].sendBehind(this.v[i - 1]);
> }
> }
> Debug.write("Build took " + ( (new Date).getTime() - start) );
> ]]></method>
>
> <method event="onclick"><![CDATA[
> var start = (new Date).getTime();
> for (var i = 0; i < 100; ++i) {
> this.v[i].destroy();
> }
> Debug.write("Destroy took " + ( (new Date).getTime() - start) );
>
> build();
> ]]></method>
> </view>
></canvas>
>
>
>------------------------------------------------------------------------
>
>_______________________________________________
>Laszlo-dev mailing list
>Laszlo-dev at openlaszlo.org
>http://www.openlaszlo.org/mailman/listinfo/laszlo-dev
>
>
More information about the Laszlo-dev
mailing list