Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Are Windows 8 XAML-based apps noticeably faster than HTML/CSS ones?

We're looking at developing a Windows 8 Metro-style app which will be very photo-heavy, so we're concerned about UI performance. On iOS it was an easy decision (Objective-C over HTML to get the UI performance we needed), but researching Windows 8 I'm having a harder time telling how much faster XAML will be than HTML5/CSS.

I've seen general comparisons between XAML and HTML5 (like this one), and there's an SO answer that touches on performance, but provides no data to back up his claim or explain why XAML is faster.

From what I've read, HTML5/CSS is rendered using IE10's rendering engine, meaning it isn't super-native and may be slower. But I'm not sure how the XAML is rendered, or just how "native" it is.

Has anyone done performance comparisons between the two technologies, or can you provide links to further explanation about how each is rendered (with performance in mind)?

like image 585
Ben Hoyt Avatar asked Sep 12 '12 05:09

Ben Hoyt


3 Answers

Speed isn't really a big issue unless you're doing some that requires some intense processing, or needs to be executed in a certain window of time.

In reality, computing has become so fast spending time on optimization is just taking time from implementing new useful features. Only optimize where need be.

I'd say make your choice based on the functionality of the 2, and how well you know each of them. Really a couple milliseconds aren't really much to worry about. I'd say most of your end users aren't going to benchmark your application, they're more likely to be drawn in by features and functionality.

We aren't running on 64kb of ram and 400mhz CPUs anymore.

Of course this is assuming you're not doing something that's processor intensive. If you are, then you're looking into the wrong technologies all together.

like image 95
tsturzl Avatar answered Oct 12 '22 01:10

tsturzl


IE10 has a hardware-accelerated engine, including a GPU accelerated HTML5 canvas. That means rendering is likely to be just as fast in HTML5 as it is in XAML, since both ways uses the GPU to render.

Logic can be a few times slower in JS, but often it doesn't matter. If your app is not bottlenecked by a heavy amount of logic processing, and like many apps is simply mainly event driven with no heavy loops, JS is probably fast enough.

Then you might want to take in to account it is far easier to port HTML5 to other platforms.

like image 35
AshleysBrain Avatar answered Oct 12 '22 01:10

AshleysBrain


Here are my thoughts on this one:

First XAML can give you a better performance than HTML5. If you use XAML combined with C++ you'll get the best performance for WinRT, because C++ is native code. If you use C# instead you depend on the CLR (Common Language Runtime) which is slower then native code.
- Reference 1
- Reference 2

Second, if you are going to include a lot of JavaScript libraries, which you probably will, it will have an impact on performance. (jQuery, jqQuery plugins, backbone.js, ...)

Then, like you said, the HTML5 in JS is rendered using IE's engine. So this is a tricky one. It really depends on how you are going to write your code. For best practices for both XAML and JS you can look here.

From personal experience. I wrote an app using XAML/C#. It feels better then Windows Phone 7 and 7.5. Mainly because they trimmed down .NET. The new async and await model is pretty good to. You can easily implement asynchronous calls, to webservice or image rendering in your case.

But I'm also interested in the numbers, so if anyone done a test, that would be great.

like image 39
Preben Huybrechts Avatar answered Oct 12 '22 01:10

Preben Huybrechts