[Laszlo-dev] how to get more efficient component response
David Temkin
temkin at laszlosystems.com
Sun Feb 10 09:05:52 PST 2008
Ryan,
There's another factor here that might be significant. When working in
native Flash, as opposed to OpenLaszlo, there are constructs that are
at the level of the "movie" that are designed to provide button
feedback and clicking. Manual Flash authoring allows you to specify, I
think, one frame with an image that's a plain state, another for
rollover, and another for mouse down. Frame changes do not require any
script execution and are therefore CPU-efficient.
OpenLaszlo's state changes for all UI controls are driven by
scripting. This takes more CPU than the "old" native Flash way of
doing things. Nevertheless, it's probably possible to eke more
performance out of the button in OpenLaszlo by measuring and
optimizing, as Henry suggests below.
Another related factor that rarely affects performance on a PC
(because of the fast CPU on a typical PC today) is that screen updates
do not occur until a new frame is drawn by the Flash player. It could
be that there is perceptible latency between the click or rollover and
the actual drawing of the new frame. On a limited-CPU device, it's
best to be very aware of redraw areas, and keep them minimal. For
example, if there are changes to the lower left of the screen during
the same event loop that creates changes to the upper right of the
screen, you may be triggering an expensive full-screen redraw.
- D.
On Feb 9, 2008, at 3:22 PM, Henry Minsky wrote:
> It's a hard question, because nobody really knows where the time is
> going.
>
> I would suggest looking at the LFC tracking the flow of control from a
> mouse click through
> the various layers, and see if some could be bypassed. For example,
> there are clicks sent through
> LzModeManager, which you may not need. Fixing this would involve
> patching or modifying
> the LFC libraries, so you need to be set up to build the LFC library.
> You can get away with small
> patches to the LFC if you put them in your code at the start of your
> app, in a <script> block.
>
> e.g.,
>
> <canvas>
> <script>
> <![CDATA[
> LzModeManager.handleMouseEvent = function (....) {
>
> }
>
> ]]>
> </script>
>
> In LPS 4, you would use
>
> <script when="immediate">
> but that won't work in LPS 3.x..
>
>
>
> On Sat, Feb 9, 2008 at 3:05 PM, Ryan Nowakowski
> <tubaman at fattuba.com> wrote:
>> I tried this on the user list and got no response so I'll ask here.
>> This is where all the smart people hang out anyway, right? ;) I'm
>> using OL
>> for embedded flash 6 development on our little touchscreen. I've
>> noticed
>> that button presses on a small app built using OL respond slower
>> than the
>> same app build using straight flash. I'm using a custom basebutton
>> class
>> that extends basecomponent. My custom class only has 2 states,
>> mouseup
>> and mousedown. Does anyone have any ideas on how to make it faster?
>>
>> For example, I don't need to track focus or listen to mouseover
>> events
>> since I'm on a touchscreen. Is there a way to disable that stuff
>> altogether?
>>
>
>
>
> --
> Henry Minsky
> Software Architect
> hminsky at laszlosystems.com
More information about the Laszlo-dev
mailing list