<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&nbsp;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&nbsp;Parann-Nissany<BR><BR>----- Original Message -----<BR>From: "Henry Minsky" &lt;henry.minsky@gmail.com&gt;<BR>To: "Gilad Parann-Nissany" &lt;gilad.parann.nissany@g.ho.st&gt;<BR>Cc: "Max Carlson" &lt;max@openlaszlo.org&gt;, "P T Withington" &lt;ptw@laszlosystems.com&gt;, "Ammar Tamazi" &lt;Ammar.Tazami@corp.g.ho.st&gt;, "laszlo-user" &lt;laszlo-user@openlaszlo.org&gt;, "Max Carlson" &lt;max@laszlosystems.com&gt;, "Elias Khalil" &lt;Elias.Khalil@corp.g.ho.st&gt;, "Lou Iorio" &lt;liorio@laszlosystems.com&gt;<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&nbsp;</P>
<DIV>flag on the Flash movieclip which it is using. . So it should already be being</DIV>
<DIV>set on drawview by default.&nbsp;</DIV>
<DIV><BR></DIV>
<DIV>See the code in lps/components/extensions/drawview.lzx to see how it is being initialized.&nbsp;</DIV>
<DIV><BR></DIV>
<DIV><BR><BR>
<DIV class=gmail_quote>On Sat, Apr 19, 2008 at 4:50 AM, Gilad Parann-Nissany &lt;<A href="mailto:gilad.parann.nissany@g.ho.st" target=_blank>gilad.parann.nissany@g.ho.st</A>&gt; 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&nbsp;Parann-Nissany</FONT></P>
<DIV>
<DIV></DIV>
<DIV class=Wj3C7c><BR><BR>----- Original Message -----<BR>From: "Max Carlson" &lt;<A href="mailto:max@openlaszlo.org" target=_blank>max@openlaszlo.org</A>&gt;<BR>To: "P T Withington" &lt;<A href="mailto:ptw@laszlosystems.com" target=_blank>ptw@laszlosystems.com</A>&gt;<BR>Cc: "Gilad Parann-Nissany" &lt;<A href="mailto:gilad.parann.nissany@g.ho.st" target=_blank>gilad.parann.nissany@g.ho.st</A>&gt;, "Max Carlson" &lt;<A href="mailto:max@laszlosystems.com" target=_blank>max@laszlosystems.com</A>&gt;, "laszlo-user" &lt;<A href="mailto:laszlo-user@openlaszlo.org" target=_blank>laszlo-user@openlaszlo.org</A>&gt;, "Ammar Tamazi" &lt;<A href="mailto:Ammar.Tazami@corp.G.ho.st" target=_blank>Ammar.Tazami@corp.G.ho.st</A>&gt;, "Elias Khalil" &lt;<A href="mailto:Elias.Khalil@corp.G.ho.st" target=_blank>Elias.Khalil@corp.G.ho.st</A>&gt;, "Lou Iorio" &lt;<A href="mailto:liorio@laszlosystems.com" target=_blank>liorio@laszlosystems.com</A>&gt;<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>&gt; On 2008-04-17, at 09:12 EDT, Gilad Parann-Nissany wrote:<BR>&gt;&gt; Hi<BR>&gt;&gt;<BR>&gt;&gt; With the help from this forum we have been making progress <BR>&gt;&gt; understanding our memory usage. See the separate thread: [Laszlo-user] <BR>&gt;&gt; Understanding memory analysis when using _LzDebug.whyAlive()<BR>&gt;&gt;<BR>&gt;&gt; We're now at the point were we see that the "smoots" taken up by <BR>&gt;&gt; Laszlo objects are not all of our memory usage. It seems a large part <BR>&gt;&gt; (large percentage of total RAM usage, maybe even more than 50%) may be <BR>&gt;&gt; used elsewhere, perhaps in the Flash objects that are "underneath" the <BR>&gt;&gt; Laszlo objects.<BR>&gt;&gt;<BR>&gt;&gt; Questions:<BR>&gt;&gt;<BR>&gt;&gt; &nbsp; &nbsp;1. Is there any tool or technique that allows us to analyze exactly <BR>&gt;&gt; how this memory is being used by Flash? ("underneath" the laszlo <BR>&gt;&gt; objects, I mean)<BR>&gt; <BR>&gt; I am not aware of such a tool. &nbsp;There may be a tool provided by Adobe.<BR><BR>Actually, this will be a nice benefit from the move to swf9. &nbsp;Flex <BR>builder (and presumably fdb) have profiling tools that can show this <BR>kind of memory usage.<BR><BR>&gt;&gt; &nbsp; &nbsp;2. Are there any guidelines to help us optimize this Flash part of <BR>&gt;&gt; our memory usage?<BR>&gt;&gt; &nbsp; &nbsp;3. More generally is there any way to use Flash-specific <BR>&gt;&gt; optimization techniques (going to the ActionScript where necessary). <BR>&gt;&gt; We know that in pure Flash there are several optimization techniques; <BR>&gt;&gt; the following points are examples of things we wish to try<BR>&gt;&gt; &nbsp; &nbsp;4. Can we in general call pieces of ActionScript from Laszlo script?<BR>&gt; <BR>&gt; Yes. &nbsp;The OL compiler does not prevent you from doing that, but neither <BR>&gt; is it supported.<BR>&gt; <BR>&gt;&gt; &nbsp; &nbsp;5. Bitmap caching:<BR>&gt;&gt;<BR>&gt;&gt;<BR>&gt;&gt; &nbsp; &nbsp; &nbsp; &nbsp;• SWF resources can be translated once into bitmaps (on the <BR>&gt;&gt; client side) and cached<BR>&gt;&gt; &nbsp; &nbsp; &nbsp; &nbsp;• you probably know this is known as bitmap caching.<BR>&gt;&gt; &nbsp; &nbsp; &nbsp; &nbsp;• Then the bitmaps are used repeatedly instead of rendering the <BR>&gt;&gt; SWF objects repeatedly.<BR>&gt;&gt; &nbsp; &nbsp; &nbsp; &nbsp;• Can we do Bitmap Caching for all those vector graphics which <BR>&gt;&gt; do not change frequently (from Laszlo, but possibly with specific <BR>&gt;&gt; usage of Actionscript if necessary)<BR>&gt; <BR>&gt; I believe Max (cc-ed) has experimented with this. &nbsp;There may even be <BR>&gt; support in LZX for it.<BR><BR>We do have support for this in drawview. &nbsp;We can experiment with adding <BR>support for vector resources as well. &nbsp;There seemed to be side effects <BR>for things with nested views, for example.<BR><BR>&gt;&gt; &nbsp; &nbsp;6.<BR>&gt;&gt; Garbage collection: we would like to trigger the Flash garbage <BR>&gt;&gt; collection just to test what is going on (as a test not permanent <BR>&gt;&gt; change). Any way for us to do this?<BR>&gt; <BR>&gt; I am not aware of a programmatic way of doing that. &nbsp;In most browsers, <BR>&gt; if you minimize the window the app is running in the Flash GC will run.<BR>&gt; <BR>&gt; Again, there are probably tools provided by Adobe for these purposes, <BR>&gt; but I have not used them. &nbsp;There are probably more tools in the open <BR>&gt; source Flex compiler, so the swf9 runtime should be easier to measure <BR>&gt; 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>