Testing Silverlight Instancing Scalability

by Jon Davis 14. December 2007 00:49

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


Computers and Internet | Software Development | Web Development


Add comment

(Will show your Gravatar icon)  

  Country flag

  • Comment
  • Preview


Powered by BlogEngine.NET
Theme by Mads Kristensen

About the author

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 was previously employed as a senior .NET developer at a very well-known Internet services company whom you're more likely than not to have directly done business with. However, this blog and all of jondavis.net have no affiliation with, and are not representative of, his former employer in any way.

Contact Me 

Tag cloud


<<  May 2021  >>

View posts in large calendar