2 <!-- Copyright 2013 the V8 project authors. Scroll to the end for full license -->
5 <meta http-equiv=
"X-UA-Compatible" value=
"IE=edge"/>
6 <meta charset=
"utf-8"/>
7 <title>Octane
2.0 JavaScript Benchmark
</title>
8 <meta name=
"viewport" content=
"width=device-width, initial-scale=1.0">
9 <meta http-equiv=
"Content-Script-Type" content=
"text/javascript">
10 <meta name=
"description"
11 content=
"Octane 2.0 JavaScript Benchmark - the Javascript benchmark for the modern web">
12 <meta name=
"author" content=
"Octane Team Google">
13 <!-- twitter bootstrap code -->
14 <script src=
"js/jquery.js"></script>
15 <script src=
"js/bootstrap-transition.js"></script>
16 <script src=
"js/bootstrap-collapse.js"></script>
17 <!-- Octane benchmark code -->
18 <script type=
"text/javascript" src=
"base.js"></script>
19 <script type=
"text/javascript" src=
"richards.js"></script>
20 <script type=
"text/javascript" src=
"deltablue.js"></script>
21 <script type=
"text/javascript" src=
"crypto.js"></script>
22 <script type=
"text/javascript" src=
"raytrace.js"></script>
23 <script type=
"text/javascript" src=
"earley-boyer.js"></script>
24 <script type=
"text/javascript" src=
"regexp.js"></script>
25 <script type=
"text/javascript" src=
"splay.js"></script>
26 <script type=
"text/javascript" src=
"navier-stokes.js"></script>
27 <script type=
"text/javascript" src=
"pdfjs.js"></script>
28 <script type=
"text/javascript" src=
"mandreel.js"></script>
29 <script type=
"text/javascript" src=
"gbemu-part1.js"></script>
30 <script type=
"text/javascript" src=
"gbemu-part2.js"></script>
31 <script type=
"text/javascript" src=
"code-load.js"></script>
32 <script type=
"text/javascript" src=
"box2d.js"></script>
33 <script type=
"text/javascript" src=
"zlib.js"></script>
34 <script type=
"text/javascript" src=
"zlib-data.js"></script>
35 <script type=
"text/javascript" src=
"typescript.js"></script>
36 <script type=
"text/javascript" src=
"typescript-input.js"></script>
37 <script type=
"text/javascript" src=
"typescript-compiler.js"></script>
39 <script type=
"text/javascript">
41 var benchmarks
= BenchmarkSuite
.CountBenchmarks();
43 var latencyBenchmarks
= ["Splay", "Mandreel"];
45 typeof skipBenchmarks
=== "undefined" ? [] : skipBenchmarks
;
47 function ShowBox(name
) {
48 var box
= document
.getElementById("Box-" + name
);
49 box
.style
.visibility
= 'visible';
50 var bar
= document
.getElementById("progress-bar").style
.width
= ""
51 + ((++completed
) / benchmarks
) * 100 + "%";
52 latencyBenchmarks
.forEach(function(entry
) {
53 if (name
.valueOf() === entry
.valueOf()) {
54 var box1
= document
.getElementById("Box-" + name
+ "Latency");
55 box1
.style
.visibility
= 'visible';
60 function AddResult(name
, result
) {
61 console
.log(name
+ ': ' + result
);
62 var box
= document
.getElementById("Result-" + name
);
63 box
.innerHTML
= result
;
66 function AddError(name
, error
) {
67 console
.log(name
+ ": " + error
.message
);
68 if (error
== "TypedArrayUnsupported") {
69 AddResult(name
, '<b>Unsupported<\/b>');
70 } else if (error
== "PerformanceNowUnsupported") {
71 AddResult(name
, '<b>Timer error<\/b>');
73 AddResult(name
, '<b>Error</b>');
78 function AddScore(score
) {
79 var status
= document
.getElementById("main-banner");
81 status
.innerHTML
= "Octane Score: " + score
;
83 status
.innerHTML
= "Octane Score (incomplete): " + score
;
85 document
.getElementById("progress-bar-container").style
.visibility
= 'hidden';
86 document
.getElementById("bottom-text").style
.visibility
= 'visible';
87 document
.getElementById("inside-anchor").removeChild(document
.getElementById("bar-appendix"));
88 document
.getElementById("alertbox").style
.visibility
= 'hidden';
92 document
.getElementById("main-banner").innerHTML
= "Running Octane...";
93 // append the progress bar elements..
94 document
.getElementById("bar-appendix").innerHTML
= "<br/><div class=\"progress progress-striped\" id=\"progress-bar-container\" style=\"visibility:hidden\"><div class=\"bar\"style=\"width: 0%;\" id=\"progress-bar\"></div></div>";
95 var anchor
= document
.getElementById("run-octane");
96 var parent
= document
.getElementById("main-container");
97 parent
.appendChild(document
.getElementById("inside-anchor"));
98 parent
.removeChild(anchor
);
100 document
.getElementById("startup-text").innerHTML
="";
102 document
.getElementById("progress-bar-container").style
.visibility
= 'visible';
104 BenchmarkSuite
.RunSuites({
105 NotifyStart
: ShowBox
,
106 NotifyError
: AddError
,
107 NotifyResult
: AddResult
,
108 NotifyScore
: AddScore
113 function CheckCompatibility() {
114 // If no Typed Arrays support, show warning label.
115 var hasTypedArrays
= typeof Uint8Array
!= "undefined"
116 && typeof Float64Array
!= "undefined"
117 && typeof (new Uint8Array(0)).subarray
!= "undefined";
119 if (!hasTypedArrays
) {
120 console
.log("Typed Arrays not supported");
121 document
.getElementById("alertbox").style
.display
="block";
123 if (window
.document
.URL
.indexOf('skip_zlib=1') >= 0)
124 skipBenchmarks
.push("zlib");
125 if (window
.document
.URL
.indexOf('auto=1') >= 0)
130 setTimeout(CheckCompatibility
, 200);
133 <!-- end Octane benchmark code -->
136 <link href=
"css/bootstrap.css" rel=
"stylesheet">
140 /*
60px to make the container go all the way to the bottom of the topbar */
143 <link href=
"css/bootstrap-responsive.css" rel=
"stylesheet">
145 <!-- Le HTML5 shim, for IE6-8 support of HTML5 elements -->
147 <script src="http://html5shim.googlecode.com/svn/trunk/html5.js"></script>
150 <!-- Le fav and touch icons -->
151 <!-- TODO update icons -->
152 <link rel=
"shortcut icon" href=
"ico/favicon.ico">
153 <link rel=
"apple-touch-icon-precomposed" sizes=
"144x144"
154 href=
"ico/apple-touch-icon-144-precomposed.png">
155 <link rel=
"apple-touch-icon-precomposed" sizes=
"114x114"
156 href=
"ico/apple-touch-icon-114-precomposed.png">
157 <link rel=
"apple-touch-icon-precomposed" sizes=
"72x72"
158 href=
"ico/apple-touch-icon-72-precomposed.png">
159 <link rel=
"apple-touch-icon-precomposed"
160 href=
"ico/apple-touch-icon-57-precomposed.png">
163 <body onLoad=
"Load()">
165 <div class=
"navbar navbar-fixed-top">
166 <div class=
"navbar-inner">
168 <div class=
"container">
170 <a class=
"brand" href=
"#">Octane
2.0</a>
171 <!--/.nav-collapse -->
177 <div class=
"container">
178 <div class=
"alert" style=
"display:none" id=
"alertbox">
179 <strong>Warning
</strong> This JavaScript engine does not support Typed Arrays. You might want to run the
<a href=
"http://v8.googlecode.com/svn/data/benchmarks/v7/run.html">V8 benchmark v7
</a> instead.
181 <div id=
"main-container">
182 <a id=
"run-octane" href=
"javascript:Run()">
183 <div class=
"hero-unit" id=
"inside-anchor">
184 <h1 align=
"center" id=
"main-banner">Start Octane
2.0</h1>
185 <div id=
"bar-appendix"></div>
190 <div id=
"startup-text" style=
"color:white;" align=
"center">
191 Welcome to Octane
2.0, a JavaScript benchmark for the modern web. For more accurate results,
<a href=
"http://developers.google.com/octane/benchmark">start the browser anew
</a> before running the test.
193 <a href=
"http://developers.google.com/octane/benchmark#whatsnew" target=
"_blank">What's new in Octane
2.0</a> -
<a href=
"http://developers.google.com/octane/">Documentation
</a> -
<a href=
"http://octane-benchmark.googlecode.com/svn/tags/v1/index.html">Run Octane v1
</a>
197 <div class=
"header"></div>
199 <div class=
"content">
202 <div class=
"box" id=
"Box-Richards" style=
"visibility: hidden;">
203 <a href=
"http://developers.google.com/octane/benchmark#richards"
204 target=
"_blank" style=
"float:left; color:#994520">Richards
</a>
206 <span class=
"p-result" id=
"Result-Richards" style=
"float:right">...
</span>
207 <span class=
"label-simple"
208 style=
"position: absolute; bottom: 3px; left: 3px;">Core
209 language features
</span>
214 <div class=
"box" id=
"Box-DeltaBlue" style=
"visibility: hidden;">
215 <a href=
"http://developers.google.com/octane/benchmark#deltablue"
216 target=
"_blank" style=
"float:left; color:#994520">Deltablue
</a>
218 <p class=
"p-result" id=
"Result-DeltaBlue" style=
"float:right">...
</p>
219 <span class=
"label-simple"
220 style=
"position: absolute; bottom: 3px; left: 3px;">Core
221 language features
</span>
225 <div class=
"box" id=
"Box-Crypto" style=
"visibility: hidden;">
226 <a href=
"http://developers.google.com/octane/benchmark#crypto"
227 target=
"_blank" style=
"float:left; color:#994520">Crypto
</a>
229 <p class=
"p-result" id=
"Result-Crypto" style=
"float:right">...
</p>
230 <span class=
"label-simple"
231 style=
"position: absolute; bottom: 3px; left: 3px;">Bit &
232 Math operations
</span>
236 <div class=
"box" id=
"Box-RayTrace" style=
"visibility: hidden;">
237 <a href=
"http://developers.google.com/octane/benchmark#raytrace"
238 target=
"_blank" style=
"float:left; color:#994520">Raytrace
</a>
240 <p class=
"p-result" id=
"Result-RayTrace" style=
"float:right">...
</p>
241 <span class=
"label-simple"
242 style=
"position: absolute; bottom: 3px; left: 3px;">Core
243 language features
</span>
253 <div class=
"box" id=
"Box-EarleyBoyer" style=
"visibility: hidden;">
255 href=
"http://developers.google.com/octane/benchmark#earleyboyer"
256 target=
"_blank" style=
"float:left; color:#994520">EarleyBoyer
</a>
258 <p class=
"p-result" id=
"Result-EarleyBoyer" style=
"float:right">...
</p>
259 <span class=
"label-simple"
260 style=
"position: absolute; bottom: 3px; left: 3px;">Memory
265 <div class=
"box" id=
"Box-RegExp" style=
"visibility: hidden;">
266 <a href=
"http://developers.google.com/octane/benchmark#regexp"
267 target=
"_blank" style=
"float:left; color:#994520">Regexp
</a>
269 <p class=
"p-result" id=
"Result-RegExp" style=
"float:right">...
</p>
270 <span class=
"label-simple"
271 style=
"position: absolute; bottom: 3px; left: 3px;">Strings
276 <div class=
"box" id=
"Box-Splay" style=
"visibility: hidden;">
277 <a href=
"http://developers.google.com/octane/benchmark#splay"
278 target=
"_blank" style=
"float:left; color:#994520">Splay
</a>
280 <p class=
"p-result" id=
"Result-Splay" style=
"float:right">...
</p>
281 <span class=
"label-simple"
282 style=
"position: absolute; bottom: 3px; left: 3px;">Memory
287 <div class=
"box" id=
"Box-SplayLatency" style=
"visibility: hidden;">
288 <a href=
"http://developers.google.com/octane/benchmark#splaylatency"
289 target=
"_blank" style=
"float:left; color:#994520">SplayLatency
</a>
291 <p class=
"p-result" id=
"Result-SplayLatency" style=
"float:right">...
</p>
292 <span class=
"label-simple"
293 style=
"position: absolute; bottom: 3px; left: 3px;">GC latency
303 <div class=
"box" id=
"Box-NavierStokes" style=
"visibility: hidden;">
305 href=
"http://developers.google.com/octane/benchmark#navierstokes"
306 target=
"_blank" style=
"float:left; color:#994520">NavierStokes
</a>
308 <p class=
"p-result" id=
"Result-NavierStokes" style=
"float:right">...
</p>
309 <span class=
"label-simple"
310 style=
"position: absolute; bottom: 3px; left: 3px;">Strings
315 <div class=
"box" id=
"Box-PdfJS" style=
"visibility: hidden;">
316 <a href=
"http://developers.google.com/octane/benchmark#pdfjs"
317 target=
"_blank" style=
"float:left; color:#994520">pdf.js
</a>
319 <p class=
"p-result" id=
"Result-PdfJS" style=
"float:right">...
</p>
320 <span class=
"label-simple"
321 style=
"position: absolute; bottom: 3px; left: 3px;">Strings
326 <div class=
"box" id=
"Box-Mandreel" style=
"visibility: hidden;">
327 <a href=
"http://developers.google.com/octane/benchmark#mandreel"
328 target=
"_blank" style=
"float:left; color:#994520">Mandreel
</a>
330 <p class=
"p-result" id=
"Result-Mandreel" style=
"float:right">...
</p>
331 <span class=
"label-simple"
332 style=
"position: absolute; bottom: 3px; left: 3px;">Virtual
337 <div class=
"box" id=
"Box-MandreelLatency" style=
"visibility: hidden;">
338 <a href=
"http://developers.google.com/octane/benchmark#mandreellatency"
339 target=
"_blank" style=
"float:left; color:#994520">MandreelLatency
</a>
341 <p class=
"p-result" id=
"Result-MandreelLatency" style=
"float:right">...
</p>
342 <span class=
"label-simple"
343 style=
"position: absolute; bottom: 3px; left: 3px;">Compiler latency
353 <div class=
"box" id=
"Box-Gameboy" style=
"visibility: hidden;">
355 href=
"http://developers.google.com/octane/benchmark#gameboyemulator"
356 target=
"_blank" style=
"float:left; color:#994520">GB Emulator
</a>
358 <p class=
"p-result" id=
"Result-Gameboy" style=
"float:right">...
</p>
359 <span class=
"label-simple"
360 style=
"position: absolute; bottom: 3px; left: 3px;">Virtual
365 <div class=
"box" id=
"Box-CodeLoad" style=
"visibility: hidden;">
366 <a href=
"http://developers.google.com/octane/benchmark#codeload"
367 target=
"_blank" style=
"float:left; color:#994520">CodeLoad
</a>
369 <p class=
"p-result" id=
"Result-CodeLoad" style=
"float:right">...
</p>
370 <span class=
"label-simple"
371 style=
"position: absolute; bottom: 3px; left: 3px;">Loading
376 <div class=
"box" id=
"Box-Box2D" style=
"visibility: hidden;">
377 <a href=
"http://developers.google.com/octane/benchmark#box2d"
378 target=
"_blank" style=
"float:left; color:#994520">Box2DWeb
</a>
380 <p class=
"p-result" id=
"Result-Box2D" style=
"float:right">...
</p>
381 <span class=
"label-simple"
382 style=
"position: absolute; bottom: 3px; left: 3px;">Bit &
383 Math operations
</span>
387 <div class=
"box" id=
"Box-zlib" style=
"visibility: hidden;">
388 <a href=
"http://developers.google.com/octane/benchmark#zlib"
389 target=
"_blank" style=
"float:left; color:#994520">zlib
</a>
391 <p class=
"p-result" id=
"Result-zlib" style=
"float:right">...
</p>
392 <span class=
"label-simple"
393 style=
"position: absolute; bottom: 3px; left: 3px;">asm.js
</span>
397 <div class=
"box" id=
"Box-Typescript" style=
"visibility: hidden;">
398 <a href=
"http://developers.google.com/octane/benchmark#typescript"
399 target=
"_blank" style=
"float:left; color:#994520">Typescript
</a>
401 <p class=
"p-result" id=
"Result-Typescript" style=
"float:right">...
</p>
402 <span class=
"label-simple"
403 style=
"position: absolute; bottom: 3px; left: 3px;">Virtual machine & GC
414 <div id=
"bottom-text" style=
"color:white; visibility:hidden" align=
"center">
416 The final score is the
<a href=
"http://en.wikipedia.org/wiki/Geometric_mean#Properties">geometric mean
</a> of the single scores. We suggest to restart the browser before repeating the test.
426 // Copyright 2013 the V8 project authors (http://code.google.com/p/v8/).
427 // All rights reserved.
428 // Redistribution and use in source and binary forms, with or without
429 // modification, are permitted provided that the following conditions are
432 // * Redistributions of source code must retain the above copyright
433 // notice, this list of conditions and the following disclaimer.
434 // * Redistributions in binary form must reproduce the above
435 // copyright notice, this list of conditions and the following
436 // disclaimer in the documentation and/or other materials provided
437 // with the distribution.
438 // * Neither the name of Google Inc. nor the names of its
439 // contributors may be used to endorse or promote products derived
440 // from this software without specific prior written permission.
442 // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
443 // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
444 // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
445 // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
446 // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
447 // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
448 // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
449 // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
450 // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
451 // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
452 // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.