Joined: 08 May 2003
Location: NC, US
|Posted: Tue Feb 27, 2007 10:12 pm Post subject: Comments about ABNet Design decisions ...
|Recently on the www-vrml mailing list there has been a
converstation on going about alternative language bindings.
Here was my comment:
|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
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
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
ActiveX function takes 1700 ms
Java function takes 11000ms
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.
in the ABNet custom VRML nodes. I think it reduces the number of
process context switches which increases responsiveness. I load
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
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.
----- Original Message -----
From: "Martin Channon"
To: "www-vrml" <www>
Sent: Tuesday, February 27, 2007 6:16 PM
Subject: Re: [www-vrml] Speed. (was alternative languages)
> That's bad news, but news I needed. Thanks.
> Joshua Smith wrote:
> >>> Bottom line: Properly written, there should be no appreciable
> >>> performance differences between algorithms written in Java vs. C.
> >> How about Java/C vs VRML & Java script?
> > or C.
> > -Joshua