| Well, I didn't benchmark specific parts of it, but here's a quick test (that's actually one of my favorite benchmarks now): The program: (you can run it in the REPL; use C-S-y to paste from OS clipboard): SS-USER> (defun sum (n)
(let rec ((n n)
(r 0))
(if (zerop n)
r
(rec (1- n) (+ r n))))) SS-USER> (time (sum 100000)) The time spent will be displayed in the ss-output buffer. Firefox: 6516ms
Chrome: 138ms Parsecs away... :-( However: (time (without-interrupts (sum 100000))) Firefox: 376ms
Chrome: 135ms Still a lot worse than Chrome, but quite a big difference. without-interrupts ensures that its body runs continuously. Normally we run 200 instructions of each thread, until we get to 50ms, then reschedule for later with setTimeout(0). So that's probably the reason why Chrome seems to do much better—maybe setTimeout is very expensive on FF. |
There's probably things you could do in the VM to optimize performance for Firefox. If you developed the VM in Chrome, typically people optimize for it Chrome. I can usually get relatively close performance if I tweak a few things here and there for both Firefox and Chrome.
Although, I think Firefox's main performance comes from JIT-ing, which you've totally lost if your running in a VM. The above example is a loop, which would usually perform great, but you've lost the JIT. That may be a reason.