I finally had a chance to play with Silverlight today. The managed code capabilities is very interesting, so I set out to create a simple performance tester.
I created two basic managed methods in Silverlight. One that multiplies a number and returns a result, and another that does the same thing a specified number of times:
public double Multiply(double a, double b)
return a * b;
public double MultiplyLoop(double a, double b, int count)
double result = 0;
for (int i = 0; i < count; i++)
result = a * b;
This gives me 3 test-cases to compare:
What I found was:
- Calling a managed method millions of times is VERY slow (IE asked me several times whether I wanted to abort it before it finished)
- Calling a managed method once and do the looping in managed code is VERY fast (0-2 ms).
You can download my test sample here: SilverlightProject1.zip (18.35 KB) (requires Orcas beta 1 and Silverlight add-on)
Now on to move all my existing .NET libraries into a Silverlight app... :-)