Return-Path: X-Original-To: apmail-flex-users-archive@www.apache.org Delivered-To: apmail-flex-users-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 0695F1066D for ; Wed, 23 Oct 2013 22:26:06 +0000 (UTC) Received: (qmail 71682 invoked by uid 500); 23 Oct 2013 22:26:04 -0000 Delivered-To: apmail-flex-users-archive@flex.apache.org Received: (qmail 71631 invoked by uid 500); 23 Oct 2013 22:26:04 -0000 Mailing-List: contact users-help@flex.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: users@flex.apache.org Delivered-To: mailing list users@flex.apache.org Received: (qmail 71198 invoked by uid 99); 23 Oct 2013 22:26:02 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 23 Oct 2013 22:26:02 +0000 X-ASF-Spam-Status: No, hits=-1.3 required=5.0 tests=FRT_ADOBE2,RCVD_IN_DNSWL_MED,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: domain of aharui@adobe.com designates 64.18.1.25 as permitted sender) Received: from [64.18.1.25] (HELO exprod6og110.obsmtp.com) (64.18.1.25) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 23 Oct 2013 22:25:53 +0000 Received: from outbound-smtp-1.corp.adobe.com ([192.150.11.134]) by exprod6ob110.postini.com ([64.18.5.12]) with SMTP ID DSNKUmhM3Eg2jGL5UU3EOe1bPhTEBdVrMd4F@postini.com; Wed, 23 Oct 2013 15:25:33 PDT Received: from inner-relay-1.corp.adobe.com ([153.32.1.51]) by outbound-smtp-1.corp.adobe.com (8.12.10/8.12.10) with ESMTP id r9NMLniH001326 for ; Wed, 23 Oct 2013 15:21:49 -0700 (PDT) Received: from SJ1SWM219.corp.adobe.com (sj1swm219.corp.adobe.com [10.5.77.61]) by inner-relay-1.corp.adobe.com (8.12.10/8.12.10) with ESMTP id r9NMPV6A029571 for ; Wed, 23 Oct 2013 15:25:31 -0700 (PDT) Received: from NAMBX02.corp.adobe.com ([10.8.127.96]) by SJ1SWM219.corp.adobe.com ([fe80::d55c:7209:7a34:fcf7%11]) with mapi; Wed, 23 Oct 2013 15:25:31 -0700 From: Alex Harui To: "users@flex.apache.org" Date: Wed, 23 Oct 2013 15:25:28 -0700 Subject: Re: any techniques to spread drawing of screen over several frames? Thread-Topic: any techniques to spread drawing of screen over several frames? Thread-Index: Ac7QPsg0kvwOQM9ySRCYg2eJBoDdKg== Message-ID: In-Reply-To: <1675343701.3050706.1382566878557.JavaMail.root@comcast.net> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: user-agent: Microsoft-MacOutlook/14.3.6.130613 acceptlanguage: en-US Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-Virus-Checked: Checked by ClamAV on apache.org Also note that, sometimes, 23 is the right number. If you have several HTTP requests coming in with data to fill combobox dataproviders with the list of cities, categories, etc, you may end up getting invalidated for each results event. -Alex On 10/23/13 3:21 PM, "modjklist@comcast.net" wrote: >Thanks Alex, you've been very helpful. I can't say I know enough to fix >it, but I can understand the complexity of the problem. > >----- Original Message ----- > >From: "Alex Harui" >To: users@flex.apache.org >Sent: Wednesday, October 23, 2013 3:10:07 PM >Subject: Re: any techniques to spread drawing of screen over several >frames?=20 > >In a very simple app, clicking on a button might generate one call to >doPhasedInstantiation, and creating the new view should generate 1 to 3 >more so that's a total of 4, not 23. An idle app does not generate calls >to doPhasedInstantiation. Moving a mouse over rollOver targets can, >though, so be careful with moving the mouse when taking snapshots. > >Sometimes a more complex view assigns data that came in asynchronously >and=20 >that will generate another 3, bringing you to 7. > >So now, it is time to justify those other calls. You can try setting >breakpoints in the debugger and see what is in the priority queues, you >can monkey patch LayoutManager, uncomment all the trace statements and >get=20 >sort of a dump of what happened, or you can keep analyzing the snapshot. >I look for updateDisplayList call counts next. There should be one per >visible component. Anything else is essentially wasteful. > >One customer was binding widths and heights to widths and heights of >other=20 >things, which causes excess laying out. Another customer was using a >third-party application framework and a third-party string resources >library that did its work on creationComplete which also triggered excess >layouts.=20 > >HTH,=20 >-Alex=20 > > >On 10/23/13 2:52 PM, "modjklist@comcast.net" >wrote:=20 > >>Thanks Alex,=20 >>=20 >>It shows 23 calls to LayoutManager.doPhasedInstantiation. >>=20 >>Note that I clicked "Reset...", then clicked the button that switches >>the app to the new view state, then waited for the state to display >>completely=20 >>on the screen, then clicked "Capture...". I'm sure there were many >>frames=20 >>that occurred between clicking "Reset..." and "Capture...", one of which >>was the=20 >>long frame in question. Not sure how to isolate the capture to that >>particular long frame >>in question ... should I worry about this? >>=20 >>----- Original Message ----- >>=20 >>From: "Alex Harui" >>To: users@flex.apache.org >>Sent: Wednesday, October 23, 2013 2:37:50 PM >>Subject: Re: any techniques to spread drawing of screen over several >>frames?=20 >>=20 >>You want to do performance profiling instead of memory profiling in the >>FB=20 >>profiler.=20 >>=20 >>Can you control when the code you want to profile will run? Maybe by >>clicking a button or something? >>=20 >>When you launch the profiler, check both the memory and performance >>boxes,=20 >>then the app should start up. In the profiler perspective, there should >>be two tabs in the upper right "Profile" and "Saved Profile Data" and >>next=20 >>to that are a bunch of icon buttons. One has the tooltip "Reset >>Performance Data" and the other is "Capture Performance Profile". Click >>the "Reset..." button then hit the button in your app that will run the >>code, then go back to the profiler and hit the "Capture..." button. That >>should put a performance snapshot in the "Profile" tab that you can >>double-click to view, and that has call counts. >>=20 >>On 10/23/13 2:29 PM, "modjklist@comcast.net" >>wrote:=20 >>=20 >>>Sure, How should I view the call count for >>>LayoutManager.doPhasedInstantiation? >>>=20 >>>Do I simply capture a Memory Snapshot before-and-after transitioning to >>>the view in question, then highlight these two snapshots, then click on >>>the Find Loitering Objects icon? At that point what am I looking for (I >>>don't see a LayoutManager Class in the Loitering Objects panel like I >>>did=20 >>>in the Live Object panel)? >>>=20 >>>=20 >>>----- Original Message ----- >>>=20 >>>From: "Alex Harui" >>>To: users@flex.apache.org >>>Sent: Wednesday, October 23, 2013 2:17:06 PM >>>Subject: Re: any techniques to spread drawing of screen over several >>>frames?=20 >>>=20 >>>Well, those numbers mean that a lot of work is going on, but it is hard >>>to=20 >>>say if it is excessive without call counts. Let's see what the FB >>>profiler has to say. >>>=20 >>>-Alex=20 >>>=20 >>>On 10/23/13 2:08 PM, "modjklist@comcast.net" >>>wrote:=20 >>>=20 >>>>Thanks Alex,=20 >>>>=20 >>>>I searched, and I'm not using creationPolicy in the app. >>>>=20 >>>>I'm using spark State, rather than a navigator view (such as spark >>>>NavigatorContent). >>>>=20 >>>>I do see in Scout that the LayoutManager.doPhasedInstantiation >>>>(mx.managers) occupies 98% of the total time for the frame in >>>>question.=20 >>>>If I analyze the memory allocations, I see (for the specific frame in >>>>question):=20 >>>>=20 >>>>LayoutManager.doPhasedInstantiation (mx.managers): Allocations =3D 6340= 5 >>>>(memory=3D19600 KB) >>>>=20 >>>>which is broken down as: >>>>=20 >>>>- LayoutManager.validateProperties (mx.managers): Allocations =3D 34210 >>>>(memory=3D11327 KB) >>>>- LayoutManager.validateDisplayList (mx.managers): Allocations =3D 2558= 8 >>>>(memory=3D7137 KB) >>>>- LayoutManager.validateSize (mx.managers): Allocations =3D 3607 >>>>(memory=3D1137 KB) >>>>=20 >>>>I have no idea if this is good or bad, as something allocated may have >>>>gotten deallocated via garbage collection (?). >>>>=20 >>>>I've used FB profiler before, but I tend to got lost among all the >>>>data=20 >>>>and windows to the point where I don't know what's going on anymore. >>>>Is=20 >>>>there an easy way to extract the call count for >>>>LayoutManager.doPhasedInstantiation for a specific frame (and how to >>>>identify that frame in the first place)? >>>>=20 >>>>I've started up the Profiler just now and it's exhibiting some odd >>>>behavior. The timeline grows as expected, but even though my app is >>>>running fine, the profiler shows no activity (the Memory Usage graph >>>>is=20 >>>>flatlined at 0 and the Live Objects table is empty). I tried on FB 4.6 >>>>and 4.7, same result. It used to work fine on FB 4.6. Any idea what it >>>>could be? The application path points to the correct >>>>bin-debug/Main.html >>>>file...=20 >>>>=20 >>>>----- Original Message ----- >>>>=20 >>>>From: "Alex Harui" >>>>To: users@flex.apache.org >>>>Sent: Wednesday, October 23, 2013 12:20:11 PM >>>>Subject: Re: any techniques to spread drawing of screen over several >>>>frames?=20 >>>>=20 >>>>I still haven't used Scout. I have used the FB Profiler so I'm just >>>>more=20 >>>>used to it. Probably time for me to try Scout. Anyway, the first thing >>>>I=20 >>>>would check is the call counts. I heard you may not be able to get >>>>that=20 >>>>from Scout so you may need to use FB. >>>>=20 >>>>Try to get the call count for LayoutManager.doPhasedInstantiation for >>>>that=20 >>>>frame It should be a small number like 3 or 4. If it is higher, then >>>>there is extra invalidation going on that, if you can eliminate it >>>>(and=20 >>>>you can't always) could drastically affect the execution time of that >>>>frame.=20 >>>>=20 >>>>A new navigator view should switch the LayoutManager to phased >>>>instantiation mode and spread the validation across multiple frames so >>>>mouse cursor doesn't stick. >>>>=20 >>>>Also make sure you are not using creationPolicy=3D"all" in any >>>>navigators.=20 >>>>That is always a performance killer. >>>>=20 >>>>Only instantiate components that are visible. Postpone instantiation >>>>of=20 >>>>components that aren't. >>>>=20 >>>>You can use various tricks like changing states to incrementally add >>>>more=20 >>>>components to the screen. >>>>=20 >>>>You can use modules to load whole sections of UI "later". >>>>=20 >>>>-Alex=20 >>>>=20 >>>>On 10/23/13 12:03 PM, "modjklist@comcast.net" >>>>wrote:=20 >>>>=20 >>>>>One of the views in my app takes a few seconds to appear on the >>>>>screen.=20 >>>>>During this time the mouse icon appears frozen (recovering after the >>>>>screen is fully drawn). >>>>>=20 >>>>>Profiling with Scout, I can see the related frame, which, this one >>>>>frame,=20 >>>>>takes a couple seconds to complete. I'm guessing this is due to a >>>>>fairly=20 >>>>>complex view to layout and draw. >>>>>=20 >>>>>When I implement a stopwatch timer throughout the ActionScript code, >>>>>the=20 >>>>>times spent within the functions are negligible. So I'm guessing most >>>>>of=20 >>>>>the time is spent behind-the-scenes somewhere drawing things. >>>>>=20 >>>>>I tried using callLater() in various places, but this just led to >>>>>problems since it changed the intended execution order of the code. >>>>>=20 >>>>>Are there any techniques to force this drawing to occur over several >>>>>frames so the mouse doesn't appear frozen to the user? >>>>=20 >>>>=20 >>>=20 >>>=20 >>=20 >>=20 > >