Profiling Flash CS3 Apps

Until watching Jun Heider’s presentation on the Flex Profiler, I never realized I could use it to profile SWF’s compiled from Flash CS3. I guess I thought there was some special flex mojo in there, but in fact, this is quite simple to do. And, you don’t event need to setup a project in Flex Builder.

  1. In your CS3 publish settings, select ‘Permit Debugging’, and compile (I mean, ‘publish’)
  2. Open the ‘Flex Profiling’ perspective in Flex Builder Pro
  3. From the Profile menu, select ‘Profile External Application’
  4. Select ‘Launch Application Manually…’ (and maybe increase the timeout to 30 seconds)
  5. Launch your app within a debug version of the flash player (9.0.124 debug worked for me)
  6. You should get a ‘Connection Established’ window in Flex Builder. Hit ‘Resume’.

Some potential issues…

  • Your SWF has debugging enabled, but it’s loaded by a preloader SWF that does not have debugging enabled. This won’t work, and it had me banging my head against the desk for 15 minutes.
  • You’re trying to launch from Flex Builder (instead of launching the app manually), but SWF’s are loading in old version of the flash player (the one that came with CS3, maybe?). You need a debug player version 9.0.115 or higher.
  • Once it opens, the profiler scares you. Check out Jun’s Presentation linked above. He goes over a lot of the terminology as well as some advanced usage scenarios.

Tags:

One Response to “Profiling Flash CS3 Apps”

  1. Phillip Kerman Says:

    Thanks for posting this… I similarly thought there was some magic going on. Naturally, it won’t really apply to me because I never have memory or performance issues… ha. Seriously, I’ll make a practice of taking a look at all apps through the profiler–if for no other reason that a quick sanity check.

    Now, I THINK the player holds on to clip instances even after issuing removeChild()… until the GC comes around. That messes me up because my main way of checking for leaks is to watch the task manager to see if the memory grows–which it does. But I guess if it drops back down eventually it’s okay. The Flex profiler is nicer for sure.

    I KNEW there was something good about Flex!