2015-04-22 02:30:22 +00:00
<!--
Copyright (C) 2014 Apple Inc. All rights reserved.
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.
-->
<!DOCTYPE html>
< html >
< head >
< title > JetStream @VERSION@< / title >
< link rel = "stylesheet" href = "JetStream.css" >
< script >
var allIsGood = true;
window.onerror = function() { allIsGood = false; }
function initialize() {
if (allIsGood)
JetStream.initialize();
else
document.getElementById("body").innerHTML = "< h1 > ERROR< / h1 > < p > Encountered errors during page load. Refusing to run a partial benchmark suite.< / p > ";
}
< / script >
< script src = "SunSpiderPayload.js" > < / script >
< script src = "SimplePayload.js" > < / script >
< script src = "JetStreamDriver.js" > < / script >
< script src = "SunSpiderSetup.js" > < / script >
< script src = "SimpleSetup.js" > < / script >
< script src = "OctaneSetup.js" > < / script >
< script src = "Octane2Setup.js" > < / script >
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
< script src = "CDjsSetup.js" > < / script >
2015-04-22 02:30:22 +00:00
< script src = "Reference.js" > < / script >
< / head >
< body onload = "initialize()" >
< main >
< a href = "index.html" > < img id = "logo" src = "JetStream-Logo.png" alt = "JetStream" > < / a >
< p class = "summary" > JetStream is a JavaScript benchmark suite focused on the most advanced web applications. For more information, read the < a href = "in-depth.html" > in-depth analysis< / a > . Bigger scores are better.< / p >
< p class = "summary" id = "mode-description" > < / p >
< div id = "result-summary" > < / div >
< div id = "status" > < a href = "javascript:JetStream.start()" > Start Test< / a > < / div >
< table id = "results" > < / table >
< / main >
< iframe id = "magic" > < / iframe >
< / body >
< / html >