.NET WebBrowser poor JavaScript performance -


i using .net webbrowser control (2.0) viewing web sites on internet in application – works fine! unfortunately discovered huge drawback on that: speed. far have found out, control performs consistently very poorly javascript (6000ms+ in sunspider vs. 150ms in ie10). verified using “retro” mode of maxthon browser, minimum working example (i.e. simple form containing browser , no other logic), , visual studio’s built-in browsers – perform equally bad. of them use ie10 version of control (turned on via registry), in theory similar performance can expected, or thought. looking spy++ @ differences between ie10 , programs using hosted control, additional wrapper shell docobject view can found: shellembedding.

http://imgur.com/csuddau shows wrapper in lower part in desktopgap's hosted webbrowser control, while ie's browser window can seen without shellembedding in upper part.

this, believe, responsible poor performance – neither know way around nor there sources - leads me question:

is there way speed webbrowser control’s performance?

so far our main idea somehow remove shellembedding , directly instantiate shell docobject view (if possible); gpu_rendering enabled , ie10 mode active (http://msdn.microsoft.com/en-us/library/ee330731%28v=vs.85%29.aspx).

additionally, seems css handling worse in ie, maybe there connection.

cheers,

claus

my suggestion check using correct doctype directive or correct browser emulation mode.

i using webbrowser component , via registry, force use ie10 mode regardless of doctype directive (setting "hkey_current_user\software\microsoft\internet explorer\main\featurecontrol\feature_browser_emulation\myexe.exe" dword 10001 (decimal).

tested html page see if there difference in js speed:

<!doctype html> <html> <head> <script>     var tick, tock;     function start() {         tick = date.now();         (var = 0; < 10000; ++i) {             var span = document.createelement('span');             testdiv.appendchild(span);             testdiv.removechild(span);         }         tock = date.now();         alert(tock - tick);     } </script> </head> <body>     <button onclick="start();">click start</button>     <div id="testdiv"></div> </body> </html> 

on computer, got following results: ie10: ~430ms webbrowser app: ~470ms chrome: 48ms

as can see, in test, there seems little difference between ie10 , webbrowser app. difference app other cpu handling in parallell take milliseconds. however, difference chrome factor 10, quite amazing.

regards, david


Comments

Popular posts from this blog

jquery - How can I dynamically add a browser tab? -

node.js - Getting the socket id,user id pair of a logged in user(s) -

keyboard - C++ GetAsyncKeyState alternative -