Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6355301
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T22:44:14+00:00 2026-05-24T22:44:14+00:00

What is an accurate way to measure the performance of a javascript engine like

  • 0

What is an accurate way to measure the performance of a javascript engine like v8 or spidermonkey ? It should at least have not very high deviations from one evaluation and another, probably allow to rank between different javascript engines on different operating systems and different hardware configurations.

My first attempt was this in a web page with nothing on it, I loaded that page in web browsers. Then I tried executing this code in Google Chrome’s javascript console and it came out very different as you’ll see in the results:

mean = function (distr) {
    var sum = 0;
    for (obs in distr) {
        sum += distr[obs];
    };
    return sum / distr.length;
};

stdev = function (distr,mean) {
    var diffsquares = 0;
    for (obs in distr) {
        diffsquares += Math.pow(distr[obs] - mean , 2);
    };
    return Math.sqrt((diffsquares / distr.length));
};


var OPs = 1000000;

var results = [];
for (var t = 0; t < 60; t++) {
    var start = (new Date()).getTime();
    for(var i = 0.5; i < OPs; i++){
        i++;
    }
    var end = (new Date()).getTime();
    var took = end - start;
    var FLOPS = OPs/took;
    results.push(FLOPS);
};

average = mean(results);
deviation = stdev(results,average);

console.log('Average: '+average+' FLOPS. Standart deviation: '+deviation+' FLOPS');

And it replied:

NodeJS 0.5.0

  1. Average: 74607.30446024566 FLOPS. Standart deviation:
    4129.4008527666265 FLOPS
  2. Average: 73974.89765136827 FLOPS. Standart
    deviation: 4574.367360870471 FLOPS
  3. Average: 73923.55086434036 FLOPS.
    Standart deviation: 5768.396926072297 FLOPS

Chrome 13.0.782.112 (From the Console (Ctrl+Shift+J))

  1. Average: 1183.409340319158 FLOPS. Standart deviation:
    24.463468674550658 FLOPS
  2. Average: 1026.8727431432026 FLOPS. Standart
    deviation: 18.32394087291766 FLOPS
  3. Average: 1063.7000331534252
    FLOPS. Standart deviation: 22.928786803808094 FLOPS

Chrome 13.0.782.112 (as a webpage)

  1. Average: 47547.03408688914 FLOPS. Standart deviation: 4064.7464541422833 FLOPS
  2. Average: 49273.65762892078 FLOPS. Standart deviation: 1553.1768207400576 FLOPS
  3. Average: 47849.72703247966 FLOPS. Standart deviation: 3445.930694070375 FLOPS

Firefox 6.0

  1. Average: 62626.63398692811 FLOPS. Standart deviation:
    3543.4801728588277 FLOPS
  2. Average: 85572.76057276056 FLOPS. Standart
    deviation: 4336.354514715926 FLOPS
  3. Average: 63780.19323671495 FLOPS.
    Standart deviation: 3323.648677036589 FLOPS

Opera 11.50

  1. Average: 38462.49044165712 FLOPS. Standart deviation:
    2438.527900104241 FLOPS
  2. Average: 37968.736460671964 FLOPS. Standart
    deviation: 2186.9271687271607 FLOPS
  3. Average: 38638.1851173518 FLOPS.
    Standart deviation: 1677.6876987114347 FLOPS

Something strange happened. The benchmark in Chrome on the console took a lot more time than the ones in other browsers and NodeJS. I mean something like 30 seconds on Chrome versus 2 on others. The standart deviations in Chrome on the console are also very small compared to others. Why this huge difference between executing the code on the console and executing code in a webpage ?

If this is all too stupid let me remind you that I “learned” javascript (and to code in general) by myself and not very long ago, so I suck at a lot of things.

What is a good measure of this ? I’d like to focus on speed of math operations and not other things like regex speed. What do you recomend ? I also tryied generating 10×10 matrixes of floating point numbers and multiplying them lots of times, the result comes every time either 7, 8 or 9 M FLOPS, but mostly 7 on Chrome, if it’s not stupid at all and someone wants the code I’m happy to pastebin it.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-24T22:44:15+00:00Added an answer on May 24, 2026 at 10:44 pm

    JS performance optimization is a huge area in general, and it’s rather ambitious to start from scratch.

    If I were you, I’d take a look at some existing projects around this space:

    • Benchmark.js handles the timing and stats analysis (averaging, computing variance) bits.
    • JSPerf lets anyone create and run tests and then look at results for any browser. There’s q large repository of tests there that you can peruse.
    • BrowserScope is the results storage for JSPerf tests, and tracks results per-UA.
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I build websites for a living and have a very accurate way to cost
I need a very accurate way to time parts of my program. I could
What is the most accurate way of timing a thread or a line of
What is the most accurate way to determine the amount of cpu speed and
What's the best / simplest / most accurate way to detect the browser of
What is the most effective and accurate way to geocode a UK postcode? Using
I have developed an application and I want to measure how much network bandwidth
What is the most efficient and accurate way to determine how much data is
I am using an opengl es iphone application. What is the most accurate way
If I have a CheckBox control called chkTest , what would be an accurate

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.