Common benchmarking interface, that can be added to any benchmarks.
- list - Rendering of lists by frameworks (online)
- elements - Rendering of HTML elements (online)
- selectors - Performance of CSS selectors (online)
- geometry - Rendering of simple geometry by graphics libraries (online)
- chart/rope - Line graphs rendering by charts libraries (online)
- chart/bar - Bar graphs rendering by charts libraries (online)
- todomvc - ToDoMVC workflow by frameworks (online)
- Unified todomvc - ToDoMVC workflow by react-like libraries (online)
Benchmark is html page, opened in iframe, and communicates with $hyoo_bench by RPC.
Benchmark must receive messages as array of values. First value is procedure name. Other values is procedure arguments.
window.addEventListener( 'message' , function( event ) {
window[ event.data[0] ].apply( null , event.data.slice( 1 ) )
} )
To return result, benchmark must send message to parent frame.
function done( result ) {
if( parent === window ) console.log( result )
else parent.postMessage( [ 'done' , result ] , '*' )
}
At start $hyoo_bench sends [ 'meta' ]
to get benchmark meta information in this format:
type meta = {
title : { [ lang : string ] : string }
descr : { [ lang : string ] : string }
samples : { [ sample : string ] : {
title : { [ lang : string ] : string }
} }
steps : { [ step : string ] : {
title : { [ lang : string ] : string }
} }
params : { [ param : string ] : {
title : { [ lang : string ] : string }
default : number
type : string
precision : number
} }
}
Description supports markdown. For every sample and step benchmark will receive message [ step , sample, params ]
.
Deploy benchmark to web server. In example: //localhost:9080/hyoo/bench/geometry/
Open $hyoo_bench_app and type in developer console command like this to switch to your benchmark:
$hyoo_bench_app.root(0).bench( '//localhost:9080/hyoo/bench/geometry/' )
Pass url to benchmark in bench
parameter to http://localhost:9080/hyoo/bench/app/
Example:
http://localhost:9080/hyoo/bench/app/#bench=..%2Fgeometry