SilverLight performance is better than JavaScript?

The speed advantage was recently discussed on Silverlight. Silverlight’s argument is that it is better than Javascript in the browser because it is compiled (and managed) code.

< /p>

Then said that this advantage only applies to IE, because IE is inefficient in interpreting Javascript compared with other browsers (such as Chrome and FireFox), compiling Javascript into machine code before execution, and it is the same as Silverlight .

Someone has a clear answer to this performance question. That is, Do / Will Silverlight and Javascript have comparable performance on Chrome and Firefox?

Speculation is fun or we can actually try one or two tests…

This Silverlight vs. Javascript chess sample has been updated to Silverlight 2. When I run it, C# averages 420,000 nodes per second, and JavaScript 23,000 nodes per second. I am running the development branch of Google Chrome (v. 0.4.154.25). For Silverlight, this is still an advantage of 18 times the speed.

Primes calculations show that Silverlight has a 3 times advantage: it takes 3.7 seconds to calculate 1,000,000 prime numbers in Javascript, and 1.2 seconds in Silverlight .

So I think that Silverlight still has a great advantage for calculations, and my intuition is that it may stay this way. Both parties will continue to optimize, but you can optimize yours through dynamic language Some limitations.

Silverlight has no advantage in animation. For example, Bubblemark test shows Javascript running at 170 fps and Silverlight running at 100 fps. I think we can expect to see this change when Silverlight 3 comes out, since it will include GPU support.

The speed advantage was recently discussed on Silverlight. The argument of Silverlight is that it is better than Javascript in the browser because It is compiled (and managed) code.

Then said, this advantage only applies to IE, because IE is inefficient in interpreting Javascript compared with other browsers (such as Chrome and FireFox). Before execution, compile Javascript into machine code, and it is the same as Silverlight.

Someone has a clear answer to this performance question. That is, Do / Will Silverlight and Javascript have comparable performance on Chrome and Firefox?

The speculation is fun or we can actually try one or two tests…

This Silverlight vs. Javascript chess sample has been Update to Silverlight 2. When I run it, C# averages 420,000 nodes per second, and JavaScript 23,000 nodes per second. I’m running the development branch of Google Chrome (v.0.4.154.25). For Silverlight, this is still This is the advantage of 18 times the speed.

Primes calculations show the 3 times advantage of Silverlight: It takes 3.7 seconds to calculate 1,000,000 prime numbers in Javascript, and 1.2 seconds in Silverlight.

So I think, For calculations, Silverlight still has a great advantage, and my intuition is that it may remain in this way. Both parties will continue to optimize, but you can optimize some of your limitations through dynamic language.

Silverlight There is no advantage in animation. For example, Bubblemark test shows Javascript running at 170 fps and Silverlight running at 100 fps. I think we can expect to see this change when Silverlight 3 comes out, since it will include GPU support.

Leave a Comment

Your email address will not be published.