Testing Silverlight Instancing Scalability

by Jon 12/14/2007 12:49:00 AM

I have been curious for several months as to how scalable Silverlight is for instancing. That is, not how scalable will Silverlight perform within itself, but rather how many instances of Silverlight can fit on a web page at a time? Is it feasible to go so far as to actually use Silverlight controls where one would normally use PNGs to decorate a page, for example?

I finally got around to digging out these numbers myself by doing a test of my own.

My test consists of an HTML file with Javascript that, when a button is pressed, will generate an instance of Silverlight with a radial gradient and add it to the HTML DOM. If the button is pressed again, another instance is generated and appended to the HTML document.

I pressed the button 100 times and manually measured each one for RAM usage. The test was performed on a x64 environment, with Internet Explorer 7.0 as the browser and Silverlight 1.1 Alpha as the Silverlight build.

My hardware environment is an AMD Athlon X2 6000+ dual core system with 4GB RAM.

Test files:

The RAM usage was a tiny bit better than I expected. Rather than taking up 2 MB or so that I feared to be the worst case scenario, the reality was only an average of roughly 300KB of RAM per instance.

The CPU usage was another story. I don't have the measurements to show for it, but let's just say that at about 80-90 instances, it took about as many seconds, divided by ten, to be able to click on the "Add Silverlight Instance" button again. That is to say, the 85th click caused me to wait about 8 or 9 seconds before I could click again. I think the CPU overhead is actually rendering and invalidating the Silverlight controls, even the ones that are below the visible threshold of the page, because when the CPU goes back down to 0% and I scroll down, I have to wait another 9 seconds before Internet Explorer will stop locking up. Clearly, there are regional invalidation issues with Silverlight, but that's perhaps due to design, since regional invalidation works differently across platforms.

I ran into some hiccups along the way; had to restart my tests once (the RAM usage was within a MB to where I left off), and lost one measurement.

By the time I got to my 100th instance, the wait was more like 20 seconds. The CPU overhead apparently seemed to escalate very quickly at 90 instances.

I'd like to see someone do the exact same test in Flash. If no one volunteers here I'll try to find the time this weekend.

kick it on DotNetKicks.com

Be the first to rate this post

  • Currently 0/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5

Tags:

Computers and Internet | Software Development | Web Development

Related posts

Comments

12/14/2007 5:52:55 PM

Matt Casto

I wonder how your test would perform if each silverlight instance had a storyboard animation repeating forever. That's something that might have a constant overhead.

I'd try it myself, but I'm using all my free time working on a Silverlight application myself. The application is a session scheduler for CodeMash (http://www.codemash.org) and I've noticed some performance issues. Specifically, there is an animation in the background that stops whenever any other animation starts, or whenever I mouse over an object that has mouse event handlers.

This is a Silverlight 1.1 Alpha app as well. I'm betting that Silverlight 1.0 performs better, and the Silverlight 2.0 beta will also show improvement. We'll see.

Thanks for your tests!!

Matt Casto us

Add comment


(Will show your Gravatar icon)  

  Country flag





Live preview

11/21/2008 7:01:23 AM


 

Powered by BlogEngine.NET 1.2.0.0
Theme by Mads Kristensen

About the author

Jon Davis Jon Davis (aka "stimpy77") has been a programmer, developer, and consultant for web and Windows software solutions professionally since 1997, with experience ranging from OS and hardware support to DHTML programming to IIS/ASP web apps to Java network programming to Visual Basic applications to C# desktop apps.
 
Software in all forms is also his sole hobby, whether playing PC games or tinkering with programming them. "I was playing Defender on the Commodore 64," he reminisces, "when I decided at the age of 12 or so that I want to be a computer programmer when I grow up."
 
Jon is currently in a temp-to-perm contract with a media corporation that primarily produces B2B magazines. The insanely complete and powerful Content Management System that they are switching to is SiteCore CMS, which is arguably the richest and most complete ASP.NET 3.5 based CMS on the planet.
E-mail me Send mail

Most Recent of Many Library Investments

Calendar

<<  November 2008  >>
MoTuWeThFrSaSu
272829303112
346789
10111213141516
17181920212223
24252627282930
1234567

View posts in large calendar

Pages

    Recent comments

    Authors

    Tags

    Disclaimer

    The opinions expressed herein are my own personal opinions and do not represent my employer's view in anyway.

    © Copyright 2008

    Sign in