<html><head><style type='text/css'>body { font-family: 'Verdana'; font-size: 10pt; color: #000000}</style></head><body><P>Hi</P>
<P>Thanks for the info.</P>
<P>1. Could you suggest code for the following situation: </P>
<P>- we are creating several views that have 1 resource (an SWF image)</P>
<P>- we wish the cached bitmap of the SWF resource to be calculated only once, and then the result to be reused in these several views</P>
<P>- goal is to save CPU time and memory consumption of the bitmap calculation</P>
<P>2. In general how would we write ActionScript code in an OL method ?</P>
<P>any ideas? sugegstions? code examples are requested especially.</P>
<P>thank you</P>
<P>Gilad</P>
<P><BR><BR>Gilad Parann-Nissany<BR><BR>----- Original Message -----<BR>From: "Henry Minsky" <henry.minsky@gmail.com><BR>To: "Gilad Parann-Nissany" <gilad.parann.nissany@g.ho.st><BR>Cc: "Max Carlson" <max@openlaszlo.org>, "P T Withington" <ptw@laszlosystems.com>, "Ammar Tamazi" <Ammar.Tazami@corp.g.ho.st>, "laszlo-user" <laszlo-user@openlaszlo.org>, "Max Carlson" <max@laszlosystems.com>, "Elias Khalil" <Elias.Khalil@corp.g.ho.st>, "Lou Iorio" <liorio@laszlosystems.com><BR>Sent: Saturday, April 19, 2008 1:32:53 PM (GMT+0200) Auto-Detected<BR>Subject: Re: [Laszlo-user] Understanding Flash memory usage when using Laszlo<BR><BR>It appears that the drawview has a "cachebitmap" attribute already, which sets the cacheAsBitmap </P>
<DIV>flag on the Flash movieclip which it is using. . So it should already be being</DIV>
<DIV>set on drawview by default. </DIV>
<DIV><BR></DIV>
<DIV>See the code in lps/components/extensions/drawview.lzx to see how it is being initialized. </DIV>
<DIV><BR></DIV>
<DIV><BR><BR>
<DIV class=gmail_quote>On Sat, Apr 19, 2008 at 4:50 AM, Gilad Parann-Nissany <<A href="mailto:gilad.parann.nissany@g.ho.st" target=_blank>gilad.parann.nissany@g.ho.st</A>> wrote:<BR>
<BLOCKQUOTE class=gmail_quote style="PADDING-LEFT: 1ex; MARGIN: 0px 0px 0px 0.8ex; BORDER-LEFT: #ccc 1px solid">
<DIV>
<P>Thank you for the input. Could you give us concrete code examples of:</P>
<P>1. calling ActionScript directly in our OL code</P>
<P>2. using drawview (or any other technique) to create a bitmap cache of our SWFs. Note: we can limit ourselves to "simple views' (views that do not nest other views) as a first step if necessary.</P>
<P>Gilad</P>
<P><BR><FONT color=#888888><BR>Gilad Parann-Nissany</FONT></P>
<DIV>
<DIV></DIV>
<DIV class=Wj3C7c><BR><BR>----- Original Message -----<BR>From: "Max Carlson" <<A href="mailto:max@openlaszlo.org" target=_blank>max@openlaszlo.org</A>><BR>To: "P T Withington" <<A href="mailto:ptw@laszlosystems.com" target=_blank>ptw@laszlosystems.com</A>><BR>Cc: "Gilad Parann-Nissany" <<A href="mailto:gilad.parann.nissany@g.ho.st" target=_blank>gilad.parann.nissany@g.ho.st</A>>, "Max Carlson" <<A href="mailto:max@laszlosystems.com" target=_blank>max@laszlosystems.com</A>>, "laszlo-user" <<A href="mailto:laszlo-user@openlaszlo.org" target=_blank>laszlo-user@openlaszlo.org</A>>, "Ammar Tamazi" <<A href="mailto:Ammar.Tazami@corp.G.ho.st" target=_blank>Ammar.Tazami@corp.G.ho.st</A>>, "Elias Khalil" <<A href="mailto:Elias.Khalil@corp.G.ho.st" target=_blank>Elias.Khalil@corp.G.ho.st</A>>, "Lou Iorio" <<A href="mailto:liorio@laszlosystems.com" target=_blank>liorio@laszlosystems.com</A>><BR>Sent: Thursday, April 17, 2008 7:18:24 PM (GMT+0200) Auto-Detected<BR>Subject: Re: Understanding Flash memory usage when using Laszlo<BR><BR><BR><BR>P T Withington wrote:<BR>> On 2008-04-17, at 09:12 EDT, Gilad Parann-Nissany wrote:<BR>>> Hi<BR>>><BR>>> With the help from this forum we have been making progress <BR>>> understanding our memory usage. See the separate thread: [Laszlo-user] <BR>>> Understanding memory analysis when using _LzDebug.whyAlive()<BR>>><BR>>> We're now at the point were we see that the "smoots" taken up by <BR>>> Laszlo objects are not all of our memory usage. It seems a large part <BR>>> (large percentage of total RAM usage, maybe even more than 50%) may be <BR>>> used elsewhere, perhaps in the Flash objects that are "underneath" the <BR>>> Laszlo objects.<BR>>><BR>>> Questions:<BR>>><BR>>> 1. Is there any tool or technique that allows us to analyze exactly <BR>>> how this memory is being used by Flash? ("underneath" the laszlo <BR>>> objects, I mean)<BR>> <BR>> I am not aware of such a tool. There may be a tool provided by Adobe.<BR><BR>Actually, this will be a nice benefit from the move to swf9. Flex <BR>builder (and presumably fdb) have profiling tools that can show this <BR>kind of memory usage.<BR><BR>>> 2. Are there any guidelines to help us optimize this Flash part of <BR>>> our memory usage?<BR>>> 3. More generally is there any way to use Flash-specific <BR>>> optimization techniques (going to the ActionScript where necessary). <BR>>> We know that in pure Flash there are several optimization techniques; <BR>>> the following points are examples of things we wish to try<BR>>> 4. Can we in general call pieces of ActionScript from Laszlo script?<BR>> <BR>> Yes. The OL compiler does not prevent you from doing that, but neither <BR>> is it supported.<BR>> <BR>>> 5. Bitmap caching:<BR>>><BR>>><BR>>> • SWF resources can be translated once into bitmaps (on the <BR>>> client side) and cached<BR>>> • you probably know this is known as bitmap caching.<BR>>> • Then the bitmaps are used repeatedly instead of rendering the <BR>>> SWF objects repeatedly.<BR>>> • Can we do Bitmap Caching for all those vector graphics which <BR>>> do not change frequently (from Laszlo, but possibly with specific <BR>>> usage of Actionscript if necessary)<BR>> <BR>> I believe Max (cc-ed) has experimented with this. There may even be <BR>> support in LZX for it.<BR><BR>We do have support for this in drawview. We can experiment with adding <BR>support for vector resources as well. There seemed to be side effects <BR>for things with nested views, for example.<BR><BR>>> 6.<BR>>> Garbage collection: we would like to trigger the Flash garbage <BR>>> collection just to test what is going on (as a test not permanent <BR>>> change). Any way for us to do this?<BR>> <BR>> I am not aware of a programmatic way of doing that. In most browsers, <BR>> if you minimize the window the app is running in the Flash GC will run.<BR>> <BR>> Again, there are probably tools provided by Adobe for these purposes, <BR>> but I have not used them. There are probably more tools in the open <BR>> source Flex compiler, so the swf9 runtime should be easier to measure <BR>> and tune in this respect.<BR><BR>-- <BR>Regards,<BR>Max Carlson<BR>OpenLaszlo.org<BR></DIV></DIV>
<P></P></DIV></BLOCKQUOTE></DIV><BR><BR clear=all><BR>-- <BR>Henry Minsky<BR>Software Architect<BR><A href="mailto:hminsky@laszlosystems.com" target=_blank>hminsky@laszlosystems.com</A><BR><BR></DIV></body></html>