Aquarium Blog

Monday, October 03, 2005

Sparkle performance

John Gossman answered my silly comment to his previous post about Expression Interactive Designer (aka Sparkle):

In my history of Sparkle I mentioned I had worked on ToolBook. That solicited this comment:

Asymetrix's ToolBook? Wow, that was so ahead of its time! Just make sure Sparkle runs faster! :P Sorry, could not resist. I am sure Sparkle will rock.

We are currently in a performance milestone on Sparkle, dealing with our obvious perf problems and reporting real and potential Avalon perf problems to that team. The good news is overall perf is good. Startup is fine, working set is fine, but as these things go we have individual areas that don't scale well or just are awful. In Avalon you build your UI compositionally by creating Templates that generate elements for the structure. For example, rather than a Button having a Render() method that draws a bunch of rounded rectangles and text, you create a Template of primitive Shape and Text Elements, include a layout container like a Grid or Canvas and every time the system sees a Button it stamps out a copy of all those elements. Elements are not free however, and if you aren't careful with your Templates they can explode into huge structures without you noticing. This is a working set hit and layout and render takes longer. We added commands to our diagnostic menu that let us count the number of elements in different parts of the tree and dump them for further study. When we started perf work before the PDC Sparkle would startup with over 8000 elements in its UI. Today that is down to 3000 with no difference in the look and feel. I expect this number to improve considerably this week and more next as more changes come in. We virtualized some things and just got more careful in a bunch of places.

Now, let me tell you, I am trully ashamed. Did you see Sparkle running? If not, go to see the Channel9 video? It is one of those things that make me drool.

This is my answer to John, I wrote originally in his blog comments:

John, all this made me blush a great deal, however I am happy my comment led you to speak about Sparkle’s performance characteristics. I am also glad you are making so much progress. I saw in the videos on Channel9, and I think Sparkle already looked VERY impressive before the PDC.

Now, I have one concern: Not that we are all going to write such a complex UIs, but it appears that making a sophisticated Avalon application reach good performance takes much tuning.

Now, I am a newbie, but I assume that by virtualization you mean that you create and dispose (perhaps reuse?) UI elements whenever they become visible or hidden. Wouldn’t it be nice that this kind of optimization were performed by Avalon itself? This could be especially useful, since I think there is a balance to be kept among working set (number of elements) and creation-destruction rate.

And thanks for the inside story of ToolBook. I didn't use the product a lot, but I have a friend that did, and I always had a great respect for the technology.


  • Nothing to be ashamed of...I certainly wasn't upset. Performance is always an important part of app development (and frankly, one of my favorite parts). Your comment gave me a great lead in to a post I wanted to make anyway.

    By Anonymous John Gossman, at 11:34 AM  

Post a Comment

Links to this post:

Create a Link

<< Home