Subj : Re: newbie questions about porting JS to embedded processor To : Frederic Rudman From : Brendan Eich Date : Mon Dec 15 2003 04:14 pm Frederic Rudman wrote: >Hi Brendan, as per your question below: > > > >>>I don't get it: I read on the mozilla site that v5.0 of JS is now "Rhino" >>>and that that is a Java-based implementation. What am I missing? >>> >>an you point me to that document via a link? Thanks. >> >> > >The link is as follows: http://www.mozilla.org/js/ under the "What >JavaScript Implementations are Available?" section which I excerpted as >follows: > >"... This engine, code named SpiderMonkey, is implemented in C. The Rhino >engine, created primarily by Norris Boyd (also at Netscape) is a JavaScript >implementation in Java..." > >Is this not correct? > > Sure, but it doesn't say anything about "v5.0 of JS", nor does it say that SpiderMonkey is deprecated in favor of Rhino, which you seemed to say in news://news.mozilla.org:119/br302n$1a41@ripley.netscape.com: "I realize that the current versions of JS have been moved over to Java and the spidermonkey/c version is no longer the latest-and-greatest." Hence my confusion ;-). >Also, what's the difference bet. Spidermonkey and Seamonkey (I saw that name >while using the online doc. for JS_macros under Spidermonkey yet the links >and refs seemed pointed to "Seamonkey"??? > > Can you give an example of such a link or ref? If the link was of the form http://lxr.mozilla.org/seamonkey/..., that's an LXR (Linux Cross-Reference) link to source code in Mozilla's CVS repository, pulled using the CVS module "SeaMonkeyAll". SeaMonkey is the codename of the Mozilla application suite -- see http://www.mozilla.org/projects/seamonkey/. It includes SpiderMonkey, as do Mozilla Firebird, Thunderbird, and Camino. >>I would be interested in seeing that testcase. It's probably a >>synthetic benchmark. SpiderMonkey has not been optimized too much for >>such things (and optimizing for other than real-world workloads is >>fraught with hazards). It has been optimized for web pages, though, >>with more work yet to do. See http://bugzilla.mozilla.org, query for >>Browser product, JS Engine component, perf keyword. >> >> > >The testcase I got was the jsshell included as part of the regular download >from Nombas (available to all for free). I looked into the source and it >seemed completely legitimate. > > The problem is not what benchmark is "legitimate", but what accurately reproduces real-world workloads. In my experience, synthetic loop JS benchmarks do not represent real-world workload. You mentioned in your last post that you intended to use JS for UI scripting in your embedded system. Again, UI interaction in Mozilla (SeaMonkey, Firebird, Thunderbird) is heavily scripted via SpiderMonkey. Never in any performance profile (we do hierarchical profiles often, e.g. quantify) has the JS engine been on the critical path of any user-level task. It just doesn't happen that you spend long inside the interpreter loop. For your app, the same should be true -- if it isn't, you're writing too much combinatorial or numerical code in JS. /be .