-
Notifications
You must be signed in to change notification settings - Fork 1
/
run-web.jsx
67 lines (51 loc) · 1.68 KB
/
run-web.jsx
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
import "js/web.jsx";
import 'console.jsx';
import 'base.jsx';
import 'richards.jsx';
import 'deltablue.jsx';
import 'crypto.jsx';
import 'raytrace.jsx';
//import 'earley-boyer.jsx';
import 'regexp.jsx';
import 'splay.jsx';
import 'navier-stokes.jsx';
class MyBenchmarkRunner extends BenchmarkRunner {
var success = true;
var completed = 0;
var benchmarks = BenchmarkSuite.CountBenchmarks();
override function NotifyStep(name : string) : void {
var status = dom.id("status");
var percentage = (++this.completed / this.benchmarks) * 100;
status.innerHTML = "Running: " + Math.round(percentage) + "% completed.";
}
override function NotifyResult(name : string, result : string) : void {
dom.id("results").innerHTML += name + ': ' + result + "<br />";
}
override function NotifyError(name : string, error : Error) : void {
this.NotifyResult(name, "<strong>" + error.toString() + "</strong>");
this.success = false;
}
override function NotifyScore(score : string) : void {
if (this.success) {
dom.id("status").innerHTML = 'Score: ' + score;
}
}
}
class _Main {
static function run() : void {
console.log("start v8bench version " + BenchmarkSuite.version);
new Richards();
new DeltaBlue();
new Crypto();
new RayTrace();
new RegExpTest();
new Splay();
new NavierStokes();
BenchmarkSuite.RunSuites(new MyBenchmarkRunner());
}
static function main(args : string[]) : void {
dom.id("version").innerHTML = BenchmarkSuite.version;
dom.window.setTimeout(_Main.run, 200);
}
}
// vim: set expandtab: