haikuwebkit/PerformanceTests/JetStream/Octane2Setup.js

77 lines
3.7 KiB
JavaScript
Raw Permalink Normal View History

JetStream should include a JavaScript version of the CDx real-time benchmark https://bugs.webkit.org/show_bug.cgi?id=146156 Reviewed by Geoffrey Garen. This adds a JavaScript port of the CDx real-time benchmark to JetStream, and retires the cordic test because it was previously the smallest and probably least interesting. The new test, "cdjs", is mostly a faithful rewrite of the Java code into JavaScript. I got the Java code from https://www.cs.purdue.edu/sss/projects/cdx/. There are some differences: - It uses RedBlackTree's for all sets and maps rather than hashtables. This is clearly more in the spirit of real-time than the CDx benchmark. FWIW, CDx used to use trees and I don't know why that changed in the latest version. - CDjs doesn't attempt to avoid memory allocations, unlike the real-time Java version. I wrote the code that I wanted to write for aesthetics, rather than the code that I would have written if I tried to write the fastest code possible. Again, I believe that this is in the spirit of CDj - it's meant to test what would happen if you wrote real-timey stuff in a high level language and actually took advantage of that language to be more productive. The test score reflects the average latency of the worst 10 samples out of 200 samples. The simulation uses 1000 aircraft, flying along paths that result in some detected collisions every once in a while. The benchmark validates its results by checking the total number of collisions detected. Apart from the integration into the JetStream harness, the CDjs directory contains a fully self-contained benchmark that could be run either in the jsc shell or in browser. This new code uses the same 3-clause BSD license as the Purdue code, and gives attribution to Purdue in almost all files. I believe that is appropriate since I wrote most of the JS files by looking at the Purdue Java code and trascribing to JavaScript. In some cases, I even copy-pasted the Java code, like the complicated math for four-dimensional intersections and voxel hashing. * JetStream/CDjsSetup.js: Added. * JetStream/Octane2Setup.js: * JetStream/Reference.js: * JetStream/cdjs: Added. * JetStream/cdjs/benchmark.js: Added. (benchmark): * JetStream/cdjs/call_sign.js: Added. (CallSign): (CallSign.prototype.compareTo): (CallSign.prototype.toString): * JetStream/cdjs/collision.js: Added. (Collision): (Collision.prototype.toString): * JetStream/cdjs/collision_detector.js: Added. (CollisionDetector): (CollisionDetector.prototype.handleNewFrame.get for): (CollisionDetector.prototype.handleNewFrame): * JetStream/cdjs/constants.js: Added. * JetStream/cdjs/main.html: Added. * JetStream/cdjs/main.js: Added. * JetStream/cdjs/motion.js: Added. (Motion): (Motion.prototype.toString): (Motion.prototype.delta): (Motion.prototype.findIntersection): * JetStream/cdjs/motion_test.js: Added. (checkDoesIntersect): (checkDoesNotIntersect): (makeMotion): * JetStream/cdjs/red_black_tree.js: Added. (RedBlackTree): (RedBlackTree.): * JetStream/cdjs/red_black_tree_test.js: Added. (test): (test.): * JetStream/cdjs/reduce_collision_set.js: Added. (drawMotionOnVoxelMap): (drawMotionOnVoxelMap.): (.get reduceCollisionSet): * JetStream/cdjs/reduce_collision_set_test.js: Added. (makeMotion): (keys): (test): * JetStream/cdjs/simulator.js: Added. (Simulator): (Simulator.prototype.simulate): * JetStream/cdjs/util.js: Added. (compareNumbers): (averageAbovePercentile): (currentTime): (else.currentTime): * JetStream/cdjs/vector_2d.js: Added. (Vector2D): (Vector2D.prototype.plus): (Vector2D.prototype.minus): (Vector2D.prototype.toString): (Vector2D.prototype.compareTo): * JetStream/cdjs/vector_3d.js: Added. (Vector3D): (Vector3D.prototype.plus): (Vector3D.prototype.minus): (Vector3D.prototype.dot): (Vector3D.prototype.squaredMagnitude): (Vector3D.prototype.magnitude): (Vector3D.prototype.times): (Vector3D.prototype.as2D): (Vector3D.prototype.toString): * JetStream/create.rb: * JetStream/index-TEMPLATE.html: * JetStream/sunspider/cordic.js: Removed. Canonical link: https://commits.webkit.org/164223@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@185780 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2015-06-19 23:49:38 +00:00
// Copyright (C) 2014, 2015 Apple Inc. All rights reserved.
Add JetStream to PerformanceTests https://bugs.webkit.org/show_bug.cgi?id=144024 Rubber-stamped by Filip Pizlo. * JetStream: Added. * JetStream/JetStream-Logo.png: Added. * JetStream/JetStream-Logo@2x.png: Added. * JetStream/JetStream.css: Added. * JetStream/JetStreamDriver.js: Added. * JetStream/LICENSE.txt: Added. * JetStream/LLVM-test-suite-LICENSE.txt: Added. * JetStream/Octane: Added. * JetStream/Octane/base.js: Added. * JetStream/Octane/code-load.js: Added. * JetStream/Octane2: Added. * JetStream/Octane2/base.js: Added. * JetStream/Octane2/box2d.js: Added. * JetStream/Octane2/code-load.js: Added. * JetStream/Octane2/crypto.js: Added. * JetStream/Octane2/deltablue.js: Added. * JetStream/Octane2/earley-boyer.js: Added. * JetStream/Octane2/gbemu-part1.js: Added. * JetStream/Octane2/gbemu-part2.js: Added. * JetStream/Octane2/mandreel.js: Added. * JetStream/Octane2/navier-stokes.js: Added. * JetStream/Octane2/pdfjs.js: Added. * JetStream/Octane2/raytrace.js: Added. * JetStream/Octane2/regexp.js: Added. * JetStream/Octane2/richards.js: Added. * JetStream/Octane2/run.js: Added. * JetStream/Octane2/splay.js: Added. * JetStream/Octane2/typescript-compiler.js: Added. * JetStream/Octane2/typescript-input.js: Added. * JetStream/Octane2/typescript.js: Added. * JetStream/Octane2/zlib-data.js: Added. * JetStream/Octane2/zlib.js: Added. * JetStream/Octane2Setup.js: Added. * JetStream/OctaneSetup.js: Added. * JetStream/README: Added. * JetStream/Reference.js: Added. * JetStream/SimpleSetup.js: Added. * JetStream/SunSpiderSetup.js: Added. * JetStream/Swoosh.png: Added. * JetStream/Swoosh@2x.png: Added. * JetStream/TestingSetup.js: Added. * JetStream/create.rb: Added. * JetStream/docs: Added. * JetStream/docs/JetStreamBlogPost.html: Added. * JetStream/in-depth-TEMPLATE.html: Added. * JetStream/index-TEMPLATE.html: Added. * JetStream/simple: Added. * JetStream/simple/bigfib.cpp: Added. * JetStream/simple/bigfib.cpp.js: Added. * JetStream/simple/container.cpp: Added. * JetStream/simple/container.cpp.js: Added. * JetStream/simple/dry.c: Added. * JetStream/simple/dry.c.js: Added. * JetStream/simple/float-mm.c: Added. * JetStream/simple/float-mm.c.js: Added. * JetStream/simple/gcc-loops.cpp: Added. * JetStream/simple/gcc-loops.cpp.js: Added. * JetStream/simple/hash-map.js: Added. * JetStream/simple/n-body.c: Added. * JetStream/simple/n-body.c.js: Added. * JetStream/simple/quicksort.c: Added. * JetStream/simple/quicksort.c.js: Added. * JetStream/simple/towers.c: Added. * JetStream/simple/towers.c.js: Added. * JetStream/sunspider: Added. * JetStream/sunspider/3d-cube.js: Added. * JetStream/sunspider/3d-raytrace.js: Added. * JetStream/sunspider/base64.js: Added. * JetStream/sunspider/cordic.js: Added. * JetStream/sunspider/crypto-aes.js: Added. * JetStream/sunspider/crypto-md5.js: Added. * JetStream/sunspider/crypto-sha1.js: Added. * JetStream/sunspider/date-format-tofte.js: Added. * JetStream/sunspider/date-format-xparb.js: Added. * JetStream/sunspider/n-body.js: Added. * JetStream/sunspider/regex-dna.js: Added. * JetStream/sunspider/tagcloud.js: Added. Canonical link: https://commits.webkit.org/161992@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@183091 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2015-04-22 02:30:22 +00:00
//
// Redistribution and use in source and binary forms, with or without
// modification, are permitted provided that the following conditions
// are met:
// 1. Redistributions of source code must retain the above copyright
// notice, this list of conditions and the following disclaimer.
// 2. Redistributions in binary form must reproduce the above copyright
// notice, this list of conditions and the following disclaimer in the
// documentation and/or other materials provided with the distribution.
//
// THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
// AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
// THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
// BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
// CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
// SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
// CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
// ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
// THE POSSIBILITY OF SUCH DAMAGE.
var Octane2Suites = [
{name: "richards", category: "Throughput", files: ["richards.js"]},
{name: "delta-blue", category: "Throughput", files: ["deltablue.js"]},
{name: "crypto", category: "Throughput", files: ["crypto.js"]},
{name: "proto-raytracer", category: "Throughput", files: ["raytrace.js"]},
{name: "earley-boyer", category: "Throughput", files: ["earley-boyer.js"]},
{name: "regexp-2010", category: "Throughput", files: ["regexp.js"]},
{name: "splay", category: "Throughput", latency: true, files:["splay.js"]},
{name: "navier-stokes", category: "Throughput", files: ["navier-stokes.js"]},
{name: "pdfjs", category: "Throughput", files: ["pdfjs.js"]},
{name: "mandreel", category: "Throughput", latency: true, files: ["mandreel.js"]},
{name: "gbemu", category: "Throughput", files: ["gbemu-part1.js", "gbemu-part2.js"]},
{name: "code-first-load", category: "Latency", files: ["code-load.js"]},
{name: "box2d", category: "Throughput", files: ["box2d.js"]},
{name: "zlib", category: "Throughput", files: ["zlib.js", "zlib-data.js"]},
{name: "typescript", category: "Latency", oneRun: true, files: ["typescript.js", "typescript-input.js", "typescript-compiler.js"]}
];
for (var i = 0; i < Octane2Suites.length; ++i) {
var suite = Octane2Suites[i];
var myBenchmarks = [{
name: suite.name,
unit: suite.oneRun ? "ms" : "ms/run",
category: suite.category,
}];
if (suite.latency) {
myBenchmarks.push({
name: suite.name + "-latency",
JetStream should include a JavaScript version of the CDx real-time benchmark https://bugs.webkit.org/show_bug.cgi?id=146156 Reviewed by Geoffrey Garen. This adds a JavaScript port of the CDx real-time benchmark to JetStream, and retires the cordic test because it was previously the smallest and probably least interesting. The new test, "cdjs", is mostly a faithful rewrite of the Java code into JavaScript. I got the Java code from https://www.cs.purdue.edu/sss/projects/cdx/. There are some differences: - It uses RedBlackTree's for all sets and maps rather than hashtables. This is clearly more in the spirit of real-time than the CDx benchmark. FWIW, CDx used to use trees and I don't know why that changed in the latest version. - CDjs doesn't attempt to avoid memory allocations, unlike the real-time Java version. I wrote the code that I wanted to write for aesthetics, rather than the code that I would have written if I tried to write the fastest code possible. Again, I believe that this is in the spirit of CDj - it's meant to test what would happen if you wrote real-timey stuff in a high level language and actually took advantage of that language to be more productive. The test score reflects the average latency of the worst 10 samples out of 200 samples. The simulation uses 1000 aircraft, flying along paths that result in some detected collisions every once in a while. The benchmark validates its results by checking the total number of collisions detected. Apart from the integration into the JetStream harness, the CDjs directory contains a fully self-contained benchmark that could be run either in the jsc shell or in browser. This new code uses the same 3-clause BSD license as the Purdue code, and gives attribution to Purdue in almost all files. I believe that is appropriate since I wrote most of the JS files by looking at the Purdue Java code and trascribing to JavaScript. In some cases, I even copy-pasted the Java code, like the complicated math for four-dimensional intersections and voxel hashing. * JetStream/CDjsSetup.js: Added. * JetStream/Octane2Setup.js: * JetStream/Reference.js: * JetStream/cdjs: Added. * JetStream/cdjs/benchmark.js: Added. (benchmark): * JetStream/cdjs/call_sign.js: Added. (CallSign): (CallSign.prototype.compareTo): (CallSign.prototype.toString): * JetStream/cdjs/collision.js: Added. (Collision): (Collision.prototype.toString): * JetStream/cdjs/collision_detector.js: Added. (CollisionDetector): (CollisionDetector.prototype.handleNewFrame.get for): (CollisionDetector.prototype.handleNewFrame): * JetStream/cdjs/constants.js: Added. * JetStream/cdjs/main.html: Added. * JetStream/cdjs/main.js: Added. * JetStream/cdjs/motion.js: Added. (Motion): (Motion.prototype.toString): (Motion.prototype.delta): (Motion.prototype.findIntersection): * JetStream/cdjs/motion_test.js: Added. (checkDoesIntersect): (checkDoesNotIntersect): (makeMotion): * JetStream/cdjs/red_black_tree.js: Added. (RedBlackTree): (RedBlackTree.): * JetStream/cdjs/red_black_tree_test.js: Added. (test): (test.): * JetStream/cdjs/reduce_collision_set.js: Added. (drawMotionOnVoxelMap): (drawMotionOnVoxelMap.): (.get reduceCollisionSet): * JetStream/cdjs/reduce_collision_set_test.js: Added. (makeMotion): (keys): (test): * JetStream/cdjs/simulator.js: Added. (Simulator): (Simulator.prototype.simulate): * JetStream/cdjs/util.js: Added. (compareNumbers): (averageAbovePercentile): (currentTime): (else.currentTime): * JetStream/cdjs/vector_2d.js: Added. (Vector2D): (Vector2D.prototype.plus): (Vector2D.prototype.minus): (Vector2D.prototype.toString): (Vector2D.prototype.compareTo): * JetStream/cdjs/vector_3d.js: Added. (Vector3D): (Vector3D.prototype.plus): (Vector3D.prototype.minus): (Vector3D.prototype.dot): (Vector3D.prototype.squaredMagnitude): (Vector3D.prototype.magnitude): (Vector3D.prototype.times): (Vector3D.prototype.as2D): (Vector3D.prototype.toString): * JetStream/create.rb: * JetStream/index-TEMPLATE.html: * JetStream/sunspider/cordic.js: Removed. Canonical link: https://commits.webkit.org/164223@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@185780 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2015-06-19 23:49:38 +00:00
unit: "ms",
Add JetStream to PerformanceTests https://bugs.webkit.org/show_bug.cgi?id=144024 Rubber-stamped by Filip Pizlo. * JetStream: Added. * JetStream/JetStream-Logo.png: Added. * JetStream/JetStream-Logo@2x.png: Added. * JetStream/JetStream.css: Added. * JetStream/JetStreamDriver.js: Added. * JetStream/LICENSE.txt: Added. * JetStream/LLVM-test-suite-LICENSE.txt: Added. * JetStream/Octane: Added. * JetStream/Octane/base.js: Added. * JetStream/Octane/code-load.js: Added. * JetStream/Octane2: Added. * JetStream/Octane2/base.js: Added. * JetStream/Octane2/box2d.js: Added. * JetStream/Octane2/code-load.js: Added. * JetStream/Octane2/crypto.js: Added. * JetStream/Octane2/deltablue.js: Added. * JetStream/Octane2/earley-boyer.js: Added. * JetStream/Octane2/gbemu-part1.js: Added. * JetStream/Octane2/gbemu-part2.js: Added. * JetStream/Octane2/mandreel.js: Added. * JetStream/Octane2/navier-stokes.js: Added. * JetStream/Octane2/pdfjs.js: Added. * JetStream/Octane2/raytrace.js: Added. * JetStream/Octane2/regexp.js: Added. * JetStream/Octane2/richards.js: Added. * JetStream/Octane2/run.js: Added. * JetStream/Octane2/splay.js: Added. * JetStream/Octane2/typescript-compiler.js: Added. * JetStream/Octane2/typescript-input.js: Added. * JetStream/Octane2/typescript.js: Added. * JetStream/Octane2/zlib-data.js: Added. * JetStream/Octane2/zlib.js: Added. * JetStream/Octane2Setup.js: Added. * JetStream/OctaneSetup.js: Added. * JetStream/README: Added. * JetStream/Reference.js: Added. * JetStream/SimpleSetup.js: Added. * JetStream/SunSpiderSetup.js: Added. * JetStream/Swoosh.png: Added. * JetStream/Swoosh@2x.png: Added. * JetStream/TestingSetup.js: Added. * JetStream/create.rb: Added. * JetStream/docs: Added. * JetStream/docs/JetStreamBlogPost.html: Added. * JetStream/in-depth-TEMPLATE.html: Added. * JetStream/index-TEMPLATE.html: Added. * JetStream/simple: Added. * JetStream/simple/bigfib.cpp: Added. * JetStream/simple/bigfib.cpp.js: Added. * JetStream/simple/container.cpp: Added. * JetStream/simple/container.cpp.js: Added. * JetStream/simple/dry.c: Added. * JetStream/simple/dry.c.js: Added. * JetStream/simple/float-mm.c: Added. * JetStream/simple/float-mm.c.js: Added. * JetStream/simple/gcc-loops.cpp: Added. * JetStream/simple/gcc-loops.cpp.js: Added. * JetStream/simple/hash-map.js: Added. * JetStream/simple/n-body.c: Added. * JetStream/simple/n-body.c.js: Added. * JetStream/simple/quicksort.c: Added. * JetStream/simple/quicksort.c.js: Added. * JetStream/simple/towers.c: Added. * JetStream/simple/towers.c.js: Added. * JetStream/sunspider: Added. * JetStream/sunspider/3d-cube.js: Added. * JetStream/sunspider/3d-raytrace.js: Added. * JetStream/sunspider/base64.js: Added. * JetStream/sunspider/cordic.js: Added. * JetStream/sunspider/crypto-aes.js: Added. * JetStream/sunspider/crypto-md5.js: Added. * JetStream/sunspider/crypto-sha1.js: Added. * JetStream/sunspider/date-format-tofte.js: Added. * JetStream/sunspider/date-format-xparb.js: Added. * JetStream/sunspider/n-body.js: Added. * JetStream/sunspider/regex-dna.js: Added. * JetStream/sunspider/tagcloud.js: Added. Canonical link: https://commits.webkit.org/161992@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@183091 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2015-04-22 02:30:22 +00:00
category: "Latency"
});
}
var code = "";
code += "<script src=\"Octane2/base.js\"></script>\n";
for (var j = 0; j < suite.files.length; ++j)
code += "<script src=\"Octane2/" + suite.files[j] + "\"></script>\n";
code += "<script>\n";
code += "BenchmarkSuite.scores = [];\n";
code += "var __suite = BenchmarkSuite.suites[0];\n";
code += "for (var __thing = __suite.RunStep({}); __thing; __thing = __thing());\n";
code += "top.JetStream.reportResult(\n";
code += " BenchmarkSuite.GeometricMeanTime(__suite.results) / 1000,\n";
code += " BenchmarkSuite.GeometricMeanLatency(__suite.results) / 1000);\n";
code += "</script>";
JetStream.addPlan({
name: suite.name,
benchmarks: myBenchmarks,
code: code
});
}