Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.javascript > #17981

Mysterious slowdown in Chromium

From Stefan Weiss <krewecherl@gmail.com>
Newsgroups comp.lang.javascript
Subject Mysterious slowdown in Chromium
Date 2013-01-06 15:12 +0100
Organization albasani.net
Message-ID <kcc0nh$ckn$1@news.albasani.net> (permalink)

Show all headers | View raw


I was doing a quick benchmark in Chromium, when I noticed that
subsequent runs were getting slower and slower. Reduced to the minimal
case, the effect can be reproduced with this:

<!DOCTYPE html>
<html>
<head>
    <title>Test</title>
</head>
<body>
    <script>
    function bench() {
        function test() {}
        var runs = 10000000,  // adjust as needed
            t0 = +new Date();
        while (runs--) test();
        console.log((+new Date() - t0) + "ms");
    }
    </script>
    <button onclick="bench()">bench()</button>
</body>
</html>

These are the times I get for the first 15 runs:

16ms
63ms
61ms
58ms
73ms
66ms
62ms
299ms
301ms
302ms
308ms
2681ms
2608ms
2596ms
2608ms

I would have expected no significant change, or maybe even a slight
speedup due to V8's JIT compiler.

Interestingly, when the test() function is moved outside of bench(), the
slowdown is much less pronounced:

13ms
20ms
18ms
18ms
17ms
23ms
21ms
297ms
301ms
(and stays at ~ 300ms after that)

Can anybody confirm this? This is on an older version of Chromium
("Version 20.0.1132.47 Ubuntu 12.04 (144678)"), so if it's a bug, it may
have been fixed in more recent versions.


- stefan

Back to comp.lang.javascript | Previous | Next — Next in thread | Find similar | Unroll thread


Thread

Mysterious slowdown in Chromium Stefan Weiss <krewecherl@gmail.com> - 2013-01-06 15:12 +0100
  Re: Mysterious slowdown in Chromium GGolf <invalid@invalid.com> - 2013-01-06 20:22 +0530
  Re: Mysterious slowdown in Chromium Gregor Kofler <usenet@gregorkofler.com> - 2013-01-06 16:25 +0100
    Re: Mysterious slowdown in Chromium Stefan Weiss <krewecherl@gmail.com> - 2013-01-06 17:33 +0100
      Re: Mysterious slowdown in Chromium Cezary Tomczyk <cezary.tomczyk@gmail.com> - 2013-01-06 23:44 +0100
  Re: Mysterious slowdown in Chromium Scott Sauyet <scott.sauyet@gmail.com> - 2013-01-06 08:19 -0800
  Re: Mysterious slowdown in Chromium Patricia Shanahan <pats@acm.org> - 2013-01-06 08:32 -0800

csiph-web