November 25th, 2009

Memory Management: Use the Lightest Classes You Can.

David and I have been teaching Flex at a local college.  Recently David mentioned to a student that he should use a lighter-weight class for a mask than Canvas.  The student asked why.  This brings up a good point.

When you’re using various Flex framework classes, you need to stop and think.  Do I really need the class I’m using or can I get away with something smaller.  One good example is when you’re creating custom MXML components.  Many times a rookie developer will create an MXML component with a Container as the root component when all they really need to do is to make a UI Control the root component.

In the case of the question, when using a mask, a very lightweight class the Sprite could have been used if the student had not needed the mask to participate in the display list.  Otherwise, they could have used a custom class based on UIComponent, vs using the larger Canvas class.

Just to re-enforce David’s point, I created a little POC where I created three custom classes, one based on Canvas, one based on UIComponent, and one based on Sprite.  I did not create any custom code in these classes, they were simply used so that they’d be easier to call out in the Flex Builder Profiler.  Then I profiled the application and here’s a screenshot of the results.

As you can see, there can be significant memory impact when you use classes that are more robust than you need.

That being said, pay attention to the classes you use in your code, and always stop to think, do I really need to use this class, or can I get away with something that is lighter-weight?

May 21st, 2009

360|Flex Indy: Flex Profiling by Example – Resource Page Updated

I’ve uploaded the profiling samples I used to walk through memory profiling and performance profiling with the Flex Builder profiler.  (It’s a Flex Builder project archive)

For those of you that attended, you can use the AIR app that was on the USB key to get to the samples. (Just hit the home button)  For those of you that didn’t feel free to download them and the slides from the following page: http://www.iheartair.com/?page_id=197

As far as my thoughts on 360|Flex Indy, it was a very enjoyable conference.  Kudos to Tom and John because they’re big pimpin’ conference organizers!  I enjoyed seeing familiar faces while I was there in addition to meeting new ones.  Although I didn’t get to see as many sessions as I would have liked, the ones I saw were very good and/or entertaining.  Just to give you an idea of the sessions I enjoyed:

It’s a wrap…thanks again Tom and John!

April 24th, 2009

360|Flex Indy: Throw me the idol and I’ll give you the whip.

360|Flex Indy is just around the corner, and I have a request for you to help me to help you. As you may be aware, I’m doing the presentation on Flex Profiling by Example. The key to this presentation is a very small number of slides and theory, and a good number of live demonstration. That being said, I’m going to take a cue from Tom and John, and solicit community input.

Here’s the deal. This presentation is going to be 1.0 at 360|Flex Indy. I want it to be my most bad ass presentation yet, and I hope to make it worthwhile to all that attend. So, throw me the idol by giving me ideas on the type of live presentation you’d like to see and I’ll give you the whip by showing you the ropes on the Flex Profiler.

Without further ado, here’s the link to start giving me some input:

http://junsessions.uservoice.com/pages/general

Also, if you haven’t yet registered, stop slacking, and here’s the link:

http://360flex.eventbrite.com/

I thank you for your support, and see ya’ll there…

February 5th, 2009

360|Flex Indy Schedule Announced — See me on Day 3

The 360|Flex crew is preppin’ to throw down the premiere Adobe Flex conference this May.  360|Flex will take place in Indy. Draft 1 of the speaker schedule has been announced, and I’m pleased to announce two things:

1. The schedule’s tight!  It’s full of many interesting talks and some of the best speakers in the industry.  The other cool thing is that this time around they had the community help decide which 50 sessions would grace the schedule.

2. I’m excited to be speaking on Day 3 right after lunch in the integration track room.

My topic is a 200 level topic titled “Flex Application Profiling by Example”. Here’s the the abstract:

“This session will be light on slides and heavy on demonstration.  The session will start with a brief explanation of the concepts that will be discussed and then kick into high gear with demonstrations and live profiling with the Flex Builder Profiler.  During the session the features of the Flex Builder Profiler will be illustrated and light will be shed on how to analyze the data collected by the Profiler.  The goal of this session will be to arm the attendee with the ability to use the Flex Builder Profiler to help increase the responsiveness and decrease the memory consumed by their applications.”

If you know me, you know I’ve been talking about debugging and profiling for a while now.  This time around I’ve taken a queue from the 360 crew and will be structuring this session in a manner consistent with the feedback requests I’ve received from the community over the years.  That being said, take the abstract above as meaning several things:

1. I have 80 minutes, “light on slides” means that I’m gonna shoot for 20 minutes or so of slides and spend the rest of the time using the Profiler in real life!

2. What I mean by “the session will start with a brief explanation of the concepts that will be discussed and then kick into high gear with demonstrations and live profiling” is that I’m not going to spend too much time explaining memory management or profiling theory, heck, I’m not even going to spend too much time discussing the Profiler itself.  Instead I’m going to SHOW you.  Explaination will occur while we’re in the trenches running the Profiler against the sample applications.

3. The most important piece of the abstract is “arm the attendee with the ability to use the Flex Builder Profiler”.  One of the things that I’ve observed throughout my life as a speaker is that many people either know the theory or know that the tool exists.  However, the missing piece is to apply the theory while using the tool. The other thing specific to the Profiler tool is knowing how to analyze what is displayed.  The goal of the session will be to have the attendees walk out the door when it’s over and be able to use the Flex Builder 3/ Gumbo Profiler effectively.

Anyway…that’s what I’m thinking, feel free to comment if you’re planning to attend and want to see anything special.  Other than that, make sure to get yourselves registered up…don’t be that lamo that tries to register after all the tickets are sold out:

http://360flex.eventbrite.com/

See you all in May!

January 29th, 2009

Adobe TV’s MAX Channel: Watch Debugging and Profiling with Flex Builder 3

I’m probably the last to notice, but I just realized that my MAX session was posted on Adobe TV.  Here’s the direct link if you want to see a MAX session that covers the debugging and profiling features of Flex Builder.

http://tv.adobe.com/#vi+f15384v1074

Also, if you scan to the last 10-15 minutes or so of the presentation you will see an excellent overview by Mike Morearty of the new debugging features that Flex Builder Gumbo will be bringing to the table!

November 19th, 2008

MAX 2008 Day 3: Debugging and Profiling with Flex Builder

Today I will be giving the presentation “Debugging and Profiling with Flex Builder” in Moscone West Room 2011 at 11:00 am – 12:00 pm.

This will be an intermediate session so I will be trying to strike a fine balance so that those that are n00bs will be able to come away with how to use Flex Builder and those that are l33t will be able to see something they might have missed, or at least help keep the conversation going.

I’ve been playing with “Gumbo” Builder, which was has been shown at MAX for about a week and a half or so.  The Adobe team has been working very hard and I’m happy to say that from what I’ve seen “Gumbo” has got some amazing new features that definitely warrant an upgrade when its released.

Although the focus of the session will be on Flex Builder 3 features and usage, those that attend will not only see some “Gumbo” in debug/profiling action, but also an amazing SUPRISE guest speaker at the end!!

So come check it out, it’s gonna be fun!

September 12th, 2008

My 360|Flex San Jose Presentation was AMPed!

Here’s a link to my Profiler presentation…complete with audio and all:

http://www.onflex.org/ted/2008/09/360flex-sj-2008-using-flex-builder-3.php

Thanks Ted, recording team, John and Tom…and also Alex for sitting in the back of the room to help. :)

August 21st, 2008

360Flex SJC: Using the Flex Builder 3 Profiler – Slides and Code Samples

Back in Denver after a wonderful trip to San Jose for 360|Flex.  Tom and John know how to get the house rockin’, and I’m glad I had the opportunity to participate.  Although I didn’t get to see as many sessions as I had wanted, the sessions I did see I really enjoyed.  I wish I had time to bust out some reviews and notes, but I’m tired so for now, here’s the links to the rockin sessions I saw:

For those of you that were at my session, I thank you for attending and I hope that you either learned something, enjoyed something, or both.  As I mentioned, I’ve uploaded my slides and samples, and you can get to them via this link:

http://labs.realeyes.com/labs/downloads/360Flex2008-SanJose/360Flex_SJC_2008_UsingTheProfiler.zip

Also, if you missed my session, or 360 Flex itself, my session will be hosted on the Adobe Media Player channel for 360 Flex.  Here’s the link to Ted’s announcement with a comment on the post on how to add the 360Flex channel to your player:

http://www.onflex.org/ted/2008/08/360flex-15-sessions-posted.php

As I mentioned during my session, the samples I posted are nothing to write home about.  However, in addition to attendee request, here’s some notes on why I uploaded these samples with the slides:

- 360Flex_MemoryLeak.zip: It’s a very simple example with a memory leak caused by the Application.application.addEventListener( Event.ENTER_FRAME, _onEnterFrame ); call in the MyTitleWindow.mxml

- 360Flex_Profiling_FlashCS3.zip: This was the example I used to show you that you can profile Flash CS3 applications.  To recap, you:

1. Go to the Flex Builder 3 Profiling Perspective, then Profile Menu –> Profile External Application.

2. in the Profile External Application dialog choose the “Launch the application manually outside Flex Builder” radio button, set a good timeout and click the Launch button.

3. Then open the HelloProfiler.fla in Flash CS3 and launch it by going to the “Debug” menu and selecting “Debug Movie”, once it launches go back to Flex Builder and the rest will be like a standard Profiling session.

- 360Flex_Profiling_PerformanceComparison.zip AND 360Flex_Profiling_PerformanceComparison_OptimizedForProfiling.zip: These samples are the same algorithm test, just with different test code wrappers.  It is the algorithm I was profiling when I posted about the TextField warning.  The reason I included these and showed them to you during the session is that they are a good way to understand the benefits of setting your Profiler preferences and custom filters upfront before an extended profiling session.  They also illustrate the benefits of putting your test algorithms in a package other than the root package.

Anyway, that’s that, thanks again for coming, feel free to hit me up with any questions, and I’m gonna get some sleep now. ;-)

August 8th, 2008

TextField Performance + Flex Builder 3 Profiler + 360Flex

360 Flex


I’m sure that many of you might not read to the end of this article, so I’m plugging the premiere Flex conference and my session here at the beginning. Earlier in the week Tom and John had posted that they only had 50 tickets left so I was gonna help remind everyone to grab a ticket…well, I checked the site today and it looks like they’re sold out…so, I guess for those who snoozed…you know the rest.

Also, if you’re interested in the content below and want to see more about how to use the Flex Builder 3 Profiler, I’ve got a lot of cool stuffs planned, so come check out my session at 360 Flex!

TextField performance and the Flex Builder 3 Profiler


While working on the internals of a display class, I ran into the following issue when attempting a compile.

I decided to use my handy dandy Flex Builder 3 Profiler to put this warning to the test. During the test I created a function call to test the addition assignment ( += ) operator, I then created one to use TextField.appendText(). In the test application I gave myself the ability to re-execute the test as many times as I wanted to without restarting the app.

Test Round 1

I set the tester to run each algorithm 10 times. I then ran this test set three times to get an average. Being that the Flex Builder Profiler samples and the fact that the reporting unit is milliseconds, you can see from the image below that 10 runs of these algorithms does not take long enough to really tell a difference. As a matter of fact, looking at the highlighted row in the third results shows that the Flash Player executes the code so fast that the cumulative time for 10 executions of main.main:_additionAssignmentTest was 0ms!

Test Round 2

Being that 10 executions didn’t take long enough, I bumped it up to 100. Here are the results. Notice that in the third execution, contrary to the warning I got in Flex Builder according to the sampling data the addition assigment test ran faster than the appendText()

Test Round 3

Now we’re bumping it up to 1000 executions apiece. Once again, in the second set of results below, the sampling data contradicted the Flex Builder warning.

Test Round 4

I decided to bump it up to 10000. As you can see in the first set of results below, once again the sampling data contradicted the Flex Builder warning.


Test Round 5

During the previous rounds, I tested by just sending the character “a” to the two append algorithms. This time I set the tests to run for 1000 executions and sent the append algorithms the loop iterator i.toString() – resulting in anything from 0 to 999. As you can see appendText() won this round with flying colors!

Conclusion

After viewing the results of these tests you can come to realize a couple things:

1. When you’re testing, don’t just run one test. As you can see, the sampling data can fluctuate. Performance results can not only vary based on the state of the operating enviroment, but also by the data you’re testing with. In other words, if you want to be sure on performance gain, either test with the closest matching use case to your application or if you’re just assessing general performance run many tests using different scenarios.

2. Although the addition assigment ( += ) was faster than the TextField.appendText() during a couple runs, for the most part, the warning in Flex Builder was right on the money. Especially in the case of running many executions with more characters being appended to the TextField text on each iteration.

3. The Flex Builder 3 Profiler ROCKS!

Oh, and one final thing. I’ve uploaded my Flex Builder 3 Project Archive for this performance test I ran…you can access it here:

http://www.iheartair.com/wp-content/uploads/2008/08/360Flex_Profiling_PerformanceComparison.zip

See you at 360!

July 2nd, 2008

MAX 2008 – Debugging and Profiling with Flex Builder

Adobe MAX is the yearly premiere event that encompasses all things Adobe…Flex, AIR, ColdFusion, Photoshop, you name it.  This year it’s going to be November 16 – 19, 2008 in San Francisco, California.  This will be my third year at MAX, and thanks to Ted Patrick and CO, they just keep getting better and better.

That being said, I’m very excited to be speaking at MAX 2008 about the wonderful and powerful Debugging and Profiling features of Flex Builder 3!  For those of you that have seen me at past conferences such as MAX, 360Flex, Webmaniacs, RIADevShed, and FlexCamp you’ll know that I’m a sucker for good debugging tools and techniques and I love talking about this set of topics.

You can keep posted on updates to this session by using the outstanding RIA session scheduler at the MAX site and although it’s early and the time and date is subject to change, here’s the current abstract on the session:

Debugging and Profiling with Flex Builder

Learn how to use the powerful debugging and profiling tools included within Flex Builder to build high-performance, reliable applications. We’ll cover some advanced debugger features you may not know, as well as go into detail about how to get the most out of the profiler.
Speakers:    Jun Heider
Products:    Flex Builder, Flex
When:    Wednesday, November 19, 11:00 am – 12:00 pm

I’m planning for it to be an informative and entertaining session, and if there’s a chance you’ll be there and have some ideas on content you’d absolutely want to see feel free to let me know.

To find out more about MAX 2008 and register, here’s a link to the very sweet-looking and feature rich RIA site that was developed for the conference:

http://max.adobe.com/

See you there!

« Previous Entries

Upcoming Talks





A Book I Helped Write



Community


Ignite Denver Committee

Categories

Credits