Subj : Re: Whats about a JIT? To : Clemens Eisserer From : Igor Bukanov Date : Sat Oct 18 2003 04:28 pm Clemens Eisserer wrote: > Hi there! > > Would a JIT make spidermonkey significantly faster? > > Because JS is a weak-typed language, its harder to build a JIT, but e.g Psycho (a JIT for Python) does the same for python and speeds up about 2x-4x which would be cool. > > Although JITs are very complex and platform dependent it would be hard to build it..... Well, there is already at least one JIT for JS, that is a JVM running Rhino which is a pure Java implementation based on early SpiderMonkey code. Rhino by default translate JS into JVM byte code which is then is executed diectly by JVM. For a benchmark such as http://lxr.mozilla.org/mozilla/source/js/benchmarks/BenchPress.js rhino when run under JDK 1.4.2 consitently run 2 times faster then an optimized build of SM so given that JVM byte code is not an ideal form to represent JS, I guess a native JIT would bring even more benefits to SM. > > Any ideas or useable code laying arround? Given the above I guess any JIT implementation would be a reasonable starting point, like one in Mono, for example. Regards, Igor .