开发者

Performance: WPF vs Silverlight

I thought about converting an application of mine from WPF 4 to Silverlight 4. One of my reasons was the impression that Silverlight as subset of .Net 4 should need less computer resources so it would run better on netbooks. I checked this and was surprised to see that the minimum system requirements are even higher:

WPF: "Pentium 1 GHz or higher with 512 MB RAM or more"

Silverlight: X86 or x64 1.6-gigahertz (GHz) or higher processor with 512-MB of RAM

Does this res开发者_开发百科emble your experiences? Do I really have to fear that my app will run slower if I do the conversion to Silverlight?

Thanks in advance.


This matches my experiences.

Silverlight is often not as optimized as WPF. Part of this is the runtime - the runtime is not quite as mature as the full desktop CLR, and part of this is the optimizations available. That being said, every version of Silverlight is improving its performance characteristics...


The largest problem in my experience is that silverlight doesn't fully utilizy your graphics adapter (since it must be able to run inside a browser sandboxed).


Well, I haven't benchmarked anything of the sort, but I can reflect on theory.

  • Silverlight is sandboxed, WPF is not. The sandboxing has a cost (at the very least lots of extra checks to throw SecurityException).
  • Silverlight is made to run inside a browser, using a plug-in. WPF is made to run on the desktop, using the naked framework.
  • WPF was designed to 'replace' full native apps, so must be very optimized. Silverlight was designed to extend the web, which is not so responsive to begin with.

So, my guess is: yes, Silverlight is a bit slower.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜