[XML-DEV Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

Speed in Languages and Browser Architectures

  • From: "Len Bullard" <cbullard@h...>
  • To: "'XML Dev'" <xml-dev@l...>
  • Date: Wed, 28 Feb 2007 06:25:42 -0600

Speed in Languages and Browser Architectures

Given the recent threads on predictions and parsing speed, here is a copy of a post made to the VRML list on the topic of speed and performance.   So many of the people here are dedicated database wonks and thin-client developers, it is sometimes hard to see another point of view relative to browser architectures and the mix of language and performance needed by different applications.

 

This is from Rick Kimball on the topic of ‘which language is faster’.  Comments on this are invited.

 

<blockquote>

All this talk about speed.  There are so many factors that determine how long something is really going to take.

You can't just make a blanket statement that one language is going to be N% faster than another.

 

For what I'm doing, ABNet multiuser 3d server,  I have tried using a variety of methods for sending TCP/IP data over the Internet.  What I've found is that the overhead of leaving the VRML/HTML browser thread and marshalling data to java or C is slower that just making javascript calls in many cases.

Of course it all depends on what you are doing.

 

Here is a simple test.  http://vrmlworld.net/perftest/

 

It is a simple HTML page that includes my ABNet ActiveX client, my ABNet Java client and a simple

Javascript function.   The page has a bunch of buttons that time how long each method takes.  (To run the test above, you need the ABNet client installed, a working java in your browser, and Microsoft Internet Explorer).

 

I created a loop that executes a simple 'version' function 50K times in each environment.  Each function just returns a string.

 

This test illustrates how much time it takes actually to pass data from one language specific context to another when using the HTML browser.

 

The emptyloop test how long it takes javascript to loop 50k times .. 20 - 30 ms The Javascript function on my machine runs in 270 ms ActiveX function takes 1700 ms Java function takes 11000ms

 

The javascript is so fast because it probably doesn't even try to yield the CPU while you execute it.

 

The ActiveX is fairly fast but it has to the marshall the data from the COM object to the browser thread. I'm sure each time that happens, it gives the OS a chance to yield the CPU to someone else.  At least the ActiveX object is just a DLL and running in the same process as the browser.

 

The Java is dog slow, why because it has to marshall the calls across two processes (iexplore.exe and java.exe) make the call and return the marshalled data.  Lots of context switching, process yield opportunities and data marshalling going on.

 

I don't think people take in to account how much time is spent when you switch from one execution thread to another. This is especially important in VRML browsers when you are tracking changes to say something like a proximity sensor. The more frequent the changes,the quicker you need to get the changed values do something and return.

 

This is one of the reasons I do a lot of processing using javascript in the ABNet custom VRML nodes. I think it reduces the number of process context switches which increases responsiveness.  I load a chunk of VRML with scripts that "preprocess" events using javascript in the wrl wolrd before trying to notify the HTML browser.  Using this scheme, I can filter the users movement in VRML without having to switch context to a java, javascript or C++ activex object. 

 

From my experience, the longer you do what you are doing where you need to do it, the better off you are.  Even if that means using a script language built into the VRML thread you are in.

 

Any insightful comments from browser developers would be appreciated.

 

-rick

 

 

</blockquote>



[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index]


PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
 

Stylus Studio has published XML-DEV in RSS and ATOM formats, enabling users to easily subcribe to the list from their preferred news reader application.


Stylus Studio Sponsored Links are added links designed to provide related and additional information to the visitors of this website. they were not included by the author in the initial post. To view the content without the Sponsor Links please click here.

Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.