source: benchmark/ctxswitch/node_cor.js @ a82a8f4

ADTarm-ehast-experimentalenumforall-pointer-decayjacob/cs343-translationnew-astnew-ast-unique-exprpthread-emulationqualifiedEnum
Last change on this file since a82a8f4 was 9246ec6, checked in by Peter A. Buhr <pabuhr@…>, 4 years ago

add warm JIT to Node.js creation and ctxswitch benchmarks

  • Property mode set to 100644
File size: 583 bytes
Line 
1var times = 50000000
2var argc = process.argv.length // node, path
3if ( argc > 3 ) process.exit( 1 )
4if ( argc == 3 ) times = Number( process.argv[2] )
5
6function * coroutine() {
7        while ( true ) {
8                yield
9        }
10}
11cor = coroutine()
12
13for ( var i = 0; i < times; i += 1 ) { // warm git
14        cor.next();
15}
16
17var hrstart = process.hrtime()
18for ( var i = 0; i < times; i += 1 ) {
19        cor.next();
20}
21hrend = process.hrtime( hrstart )
22var dur = (1000000000 * hrend[0] + hrend[1]) / times
23console.log( dur )
24
25// Local Variables: //
26// tab-width: 4 //
27// compile-command: "nodejs node_cor.js" //
28// End: //
Note: See TracBrowser for help on using the repository browser.