PDA

View Full Version : Slow rendering in view large window


georgio
03-17-2006, 02:21 PM
Hi,

I have a view (in a window) that draws my XML data in a pretty manner. Unfortunately, when I make the window large - say 1000x1000 pixels, the rendering speed becomes awefully slow ~ 1 frame per sec. My machine is no slouch - Athlon 64 3800+ on Linux with accelerated X driver.

When I move the window around, my CPU usage hits 100%. I get the same results on a Windows machine. Also have very good performance in the Laszlo demos.

I figure there's something that I'm doing wrong in my code, but I can't figure it out. Do constraints cause every variable to be re-calculated on every re-draw? Should I use constraints with caution? What else could cause views that are drawing datasets to run very slowly.

Many thanks,
Nick

jcmaxx
03-17-2006, 04:53 PM
Do constraints cause every variable to be re-calculated on every re-draw? Should I use constraints with caution? What else could cause views that are drawing datasets to run very slowly.
Using constraints can certainly impact performance. The following was copied from http://wiki.openlaszlo.org/Performance_Optimization:
Rewrite slow code to avoid the constraint mechanism. Instead of writing <view id="foo" x="${parent.something}" y="${parent.something}">, they'll write the code that changes parent.something to update foo's x and y instead, replacing several function calls and loops through the constraint system by one function call.

georgio
03-20-2006, 07:06 AM
Thanks for the quick response.

I have changed all of my constraints to be $once{}. Unfortunately the rendering appears to be no faster than before. Does $once{} not bypass the constraint mechanism for each redraw? All I'm really trying to do is display a table of data using datapath. My data is being displayed inside a lzWindow, are there known performance issues with lzWindows?

I know the documentation at the Wiki said to avoid constraints all together, but surely Laszlo/Flash can display a largish window with dataset using constraints at more than 1 frame per second?

Any ideas?

Kind Regards,
Nick

paou
03-21-2006, 03:04 AM
I have found the same issues. Right now I'm looking into it. So far I've found large speed improvements with rendering once, and grabbing to a flash bitmap. displaying that, and hiding the content. (Either cuts down on rendering or reduces view count... not sure which is giving the speed improvement)

see this thread:

http://www.laszlosystems.com/developers/community/forums/showthread.php?s=&threadid=5721

However, if you need to interact with your data, that may not be an option.