ADTarm-ehast-experimentalenumforall-pointer-decayjacob/cs343-translationnew-astnew-ast-unique-exprpthread-emulationqualifiedEnum
Last change
on this file since 566fde0 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
|
Rev | Line | |
---|
[b4107c8] | 1 | var times = 50000000 |
---|
| 2 | var argc = process.argv.length // node, path |
---|
| 3 | if ( argc > 3 ) process.exit( 1 ) |
---|
| 4 | if ( argc == 3 ) times = Number( process.argv[2] ) |
---|
| 5 | |
---|
| 6 | function * coroutine() { |
---|
| 7 | while ( true ) { |
---|
| 8 | yield |
---|
| 9 | } |
---|
| 10 | } |
---|
| 11 | cor = coroutine() |
---|
| 12 | |
---|
[9246ec6] | 13 | for ( var i = 0; i < times; i += 1 ) { // warm git |
---|
| 14 | cor.next(); |
---|
| 15 | } |
---|
| 16 | |
---|
[b4107c8] | 17 | var hrstart = process.hrtime() |
---|
| 18 | for ( var i = 0; i < times; i += 1 ) { |
---|
| 19 | cor.next(); |
---|
| 20 | } |
---|
| 21 | hrend = process.hrtime( hrstart ) |
---|
| 22 | var dur = (1000000000 * hrend[0] + hrend[1]) / times |
---|
| 23 | console.log( dur ) |
---|
| 24 | |
---|
| 25 | // Local Variables: // |
---|
| 26 | // tab-width: 4 // |
---|
[c12869e] | 27 | // compile-command: "nodejs node_cor.js" // |
---|
[b4107c8] | 28 | // End: // |
---|
Note: See
TracBrowser
for help on using the repository browser.