JavaScript Performance Benchmark

Stephen Pair stephen at pairhome.net
Tue Apr 18 13:33:34 UTC 2006


Here at work, we built (mostly David Pennell) a JavaScript system called
Smee (an old version of it is available in the Cincom public repository).
It is a faithful implementation of the ECMAscript standard in VisualWorks.
It is compiled to VW bytecode, but message sends don't (yet) leverage VM
message lookup.  Looks like it's quite a bit faster in ops/sec than both
Firefox and IE (this was running on a Pentium M laptop under WinXP).
Amazingly, even without help from the VM for message lookup, it's still
faster in that category than IE (but lags behind Firefox).

- Stephen

Firefox:
n1 = 2; time = 60 milliseconds; 16666667 operations/sec.
n1 = 4; time = 130 milliseconds; 15384615 operations/sec.
n1 = 8; time = 261 milliseconds; 15325670 operations/sec.
n1 = 16; time = 600 milliseconds; 13333333 operations/sec.
n2 = 24; time = 151 milliseconds; 496854 sends/sec.
n2 = 25; time = 200 milliseconds; 606965 sends/sec.
n2 = 26; time = 300 milliseconds; 654727 sends/sec.
n2 = 27; time = 481 milliseconds; 660730 sends/sec.
n2 = 28; time = 791 milliseconds; 650100 sends/sec.

IE:
n1 = 2; time = 230 milliseconds; 4347826 operations/sec.
n1 = 4; time = 161 milliseconds; 12422360 operations/sec.
n1 = 8; time = 230 milliseconds; 17391304 operations/sec.
n1 = 16; time = 471 milliseconds; 16985138 operations/sec.
n2 = 24; time = 481 milliseconds; 155977 sends/sec.
n2 = 25; time = 570 milliseconds; 212970 sends/sec.

Smee:
0:  'n1 = 2; time = 40 milliseconds; 25000000 operations/sec.'
1:  'n1 = 4; time = 88 milliseconds; 22727273 operations/sec.'
2:  'n1 = 8; time = 176 milliseconds; 22727273 operations/sec.'
3:  'n1 = 16; time = 333 milliseconds; 24024024 operations/sec.'
4:  'n1 = 32; time = 694 milliseconds; 23054755 operations/sec.'
5:  'n2 = 24; time = 194 milliseconds; 386727 sends/sec.'
6:  'n2 = 25; time = 319 milliseconds; 380542 sends/sec.'
7:  'n2 = 26; time = 506 milliseconds; 388178 sends/sec.'

On 4/18/06, Bert Freudenberg <bert at impara.de> wrote:
>
> iMac G5, 1.6 GHz, software as yours. I re-ran it today, looks a bit
> better:
>
> Safari:
> n1 = 2; time = 418 milliseconds; 2392344 operations/sec.
> n1 = 4; time = 558 milliseconds; 3584229 operations/sec.
>
> n2 = 24; time = 1362 milliseconds; 55084 sends/sec.
>
>
> Firefox:
>
> n1 = 2; time = 102 milliseconds; 9803922 operations/sec.
> n1 = 4; time = 207 milliseconds; 9661836 operations/sec.
> n1 = 8; time = 413 milliseconds; 9685230 operations/sec.
> n1 = 16; time = 892 milliseconds; 8968610 operations/sec.
>
> n2 = 24; time = 137 milliseconds; 547628 sends/sec.
> n2 = 25; time = 221 milliseconds; 549290 sends/sec.
> n2 = 26; time = 358 milliseconds; 548654 sends/sec.
> n2 = 27; time = 600 milliseconds; 529685 sends/sec.
>
> ... which is still 10x more sends.
>
> - Bert -
>
> Am 13.04.2006 um 23:04 schrieb Dean_Swan at Mitel.COM:
>
> >
> > Hi Bert,
> >
> > What kind of Mac were you running on?  I get these results:
> >
> >         iBook G4 1.2 GHz, OS X 10.4.6, Safari 2.0.3 (417.9.2)
> >         n1 = 2; time = 259 milliseconds; 3861004 operations/sec.
> >         n1 = 4; time = 532 milliseconds; 3759398 operations/sec.
> >
> >         n2 = 24; time = 731 milliseconds; 102633 sends/sec.
> >
> >
> >         iBook G4 1.2 GHz, OS X 10.4.6, Firefox 1.5.0.1
> >         n1 = 2; time = 128 milliseconds; 7812500 operations/sec.
> >         n1 = 4; time = 331 milliseconds; 6042296 operations/sec.
> >         n1 = 8; time = 506 milliseconds; 7905138 operations/sec.
> >
> >         n2 = 24; time = 190 milliseconds; 394868 sends/sec.
> >         n2 = 25; time = 329 milliseconds; 368976 sends/sec.
> >         n2 = 26; time = 508 milliseconds; 386650 sends/sec.
> >
> > So,I'd say Firefox is about 2x faster for operations and 4x for
> > sends, but not 20x.
> >
> >
> > And just for fun:
> >
> >         Dell PWS370 P4 3.0 GHz, Win XP Sp2, IE
> > 6.0.2900.2180.xpsp_sp2_gdr.050301-1519
> >         n1 = 2; time = 62 milliseconds; 16129032 operations/sec.
> >        n1 = 4; time = 110 milliseconds; 18181818 operations/sec.
> >        n1 = 8; time = 219 milliseconds; 18264840 operations/sec.
> >        n1 = 16; time = 453 milliseconds; 17660044 operations/sec.
> >        n1 = 32; time = 906 milliseconds; 17660044 operations/sec.
> >
> >        n2 = 24; time = 437 milliseconds; 171682 sends/sec.
> >        n2 = 25; time = 719 milliseconds; 168836 sends/sec.
> >
> >         Dell PWS370 P4 3.0 GHz, Win XP Sp2, IE
> > 6.0.2900.2180.xpsp_sp2_gdr.050301-1519
> >         n1 = 2; time = 47 milliseconds; 21276596 operations/sec.
> >        n1 = 4; time = 109 milliseconds; 18348624 operations/sec.
> >        n1 = 8; time = 203 milliseconds; 19704433 operations/sec.
> >        n1 = 16; time = 422 milliseconds; 18957346 operations/sec.
> >        n1 = 32; time = 860 milliseconds; 18604651 operations/sec.
> >
> >        n2 = 24; time = 93 milliseconds; 806720 sends/sec.
> >        n2 = 25; time = 157 milliseconds; 773204 sends/sec.
> >        n2 = 26; time = 250 milliseconds; 785672 sends/sec.
> >        n2 = 27; time = 390 milliseconds; 814900 sends/sec.
> >        n2 = 28; time = 656 milliseconds; 783886 sends/sec.
> >
> > Here, Firefox is about the same for operations and 4x to 5x for sends.
> >
> >         -Dean
> >
> >
> >
> >
> > Bert Freudenberg <bert at impara.de>
> > Sent by: squeak-dev-bounces at lists.squeakfoundation.org
> > 04/13/2006 05:22 AM
> > Please respond to The general-purpose Squeak developers list
> >
> >
> >         To:        Dan Ingalls <Dan at SqueakLand.org>
> >         cc:        The general-purpose Squeak developers list
> > <squeak-dev at lists.squeakfoundation.org>
> >         Subject:        Re: JavaScript Performance Benchmark
> >
> >
> >
> >
> > Am 12.04.2006 um 21:59 schrieb Dan Ingalls:
> >
> > > I've been having fun with JavaScript, and thought folks would enjoy
> > > this little tribute to tinyBenchmarks...
> > >
> > >                  http://www.weather-dimensions.com/Dan/
> > JavaScriptBenchmark.html
> >
> > Fun indeed. Anyone else noticed the abysmal send performance in
> > Apple's Safari?
> >
> >                 n1 = 4; time = 646 milliseconds; 3095975 operations/
> > sec.
> >                 n2 = 24; time = 3443 milliseconds; 21791 sends/sec.
> >
> > Firefox is 20x faster:
> >
> >                 n1 = 8; time = 566 milliseconds; 7067138 operations/
> > sec.
> >                 n2 = 27; time = 743 milliseconds; 427740 sends/sec.
> >
> > - Bert -
> >
> >
> >
> >
> >
>
>
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.squeakfoundation.org/pipermail/squeak-dev/attachments/20060418/764cc242/attachment.htm


More information about the Squeak-dev mailing list