1Elm.Native.Benchmark = {};
2Elm.Native.Benchmark.make = function(localRuntime) {
4 localRuntime.Native = localRuntime.Native || {};
5 localRuntime.Native.Benchmark = localRuntime.Native.Benchmark || {};
6 if (localRuntime.Native.Benchmark.values)
8 return localRuntime.Native.Benchmark.values;
11 var List = Elm.List.make(localRuntime);
12 var Task = Elm.Native.Task.make(localRuntime);
15 // RUN SOME BENCHMARKS
17 function run(benchmark)
19 return Task.asyncFunction(function(callback)
21 var overallSuite = new Benchmark.Suite;
22 var statistics = addTests(overallSuite, benchmark);
23 overallSuite.on('complete', function(event) {
24 callback(Task.succeed(statistics));
26 overallSuite.run({ async: true });
31 // ADD TESTS TO THE JS BENCHMARK SUITE
33 function addTests(overallSuite, benchmark)
35 if (benchmark.ctor === 'Suite')
40 _1: A2(List.map, curriedAddTests(overallSuite), benchmark._1)
44 // WE MUST BE LOOKING AT A TEST
45 var name = benchmark._0;
46 var thunk = benchmark._1;
54 overallSuite.add(name, thunk, {
56 console.log('running: ' + name);
58 onComplete: function(event) {
59 var jsBenchmark = event.target;
61 mean: jsBenchmark.stats.mean,
70 var curriedAddTests = F2(addTests);
74 return localRuntime.Native.Benchmark.values = {
75 makeThunk: function(x) { return x; },
keysesc to close
- j k
- move down, up
- enter
- open
- esc
- back, or up a level
- 1 2 3 4
- readme, files, commits, refs
- /
- filter
- y
- copy the clone command
- c
- compare the chosen commit with another (or shift-click both)
- ?
- show or hide this list