Changes in / [8a13c47:6f302cd]


Ignore:
Location:
benchmark
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • benchmark/Makefile.am

    r8a13c47 r6f302cd  
    1111## Created On       : Sun May 31 09:08:15 2015
    1212## Last Modified By : Peter A. Buhr
    13 ## Last Modified On : Thu Jan 23 12:42:58 2020
    14 ## Update Count     : 253
     13## Last Modified On : Sat Jan 25 09:20:44 2020
     14## Update Count     : 255
    1515###############################################################################
    1616
     
    8989ctxswitch_rust_thread_DURATION = $(ctxswitch_pthread_DURATION)
    9090ctxswitch_cfa_generator_DURATION = 5000000000
    91 ctxswitch_nodejs_await_DURATION = 1000000 # otherwise out of memory
     91ctxswitch_nodejs_await_DURATION = 5000000
    9292ctxswitch_DURATION = 100000000
    9393
  • benchmark/Makefile.in

    r8a13c47 r6f302cd  
    426426ctxswitch_rust_thread_DURATION = $(ctxswitch_pthread_DURATION)
    427427ctxswitch_cfa_generator_DURATION = 5000000000
    428 ctxswitch_nodejs_await_DURATION = 1000000 # otherwise out of memory
     428ctxswitch_nodejs_await_DURATION = 5000000
    429429ctxswitch_DURATION = 100000000
    430430
  • benchmark/ctxswitch/node_await.js

    r8a13c47 r6f302cd  
    1 var times = 1000000
     1var times = 5000000
    22var argc = process.argv.length // node, path
    33if ( argc > 3 ) process.exit( 1 )
    44if ( argc == 3 ) times = Number( process.argv[2] )
    55
    6 var p = new Promise(
    7     function( rs ) {
    8                 resolve = rs;
    9     }
    10 );
    11 
    12 for ( var i = 0; i < times; i += 1 ) {
    13     p = p.then(
    14                 () => { return }
    15     );
     6function instant() {
     7     return new Promise(function(rs) {
     8         setImmediate(rs);
     9     });
    1610}
    1711
    18 p = p.then(
    19     () => {
    20                 hrend = process.hrtime( hrstart )
    21                 var dur = (1000000000 * hrend[0] + hrend[1]) / times
    22                 console.log( dur )
    23     }
    24 );
     12async function l() {
     13    var hrstart = process.hrtime()
     14    for ( var i = 0; i < times; i += 1 )
     15         await instant();
     16        hrend = process.hrtime( hrstart )
     17        var dur = (1000000000 * hrend[0] + hrend[1]) / times
     18        console.log( dur )
     19}
    2520
    26 var hrstart = process.hrtime()
    27 resolve();
     21l();
    2822
    2923// Local Variables: //
Note: See TracChangeset for help on using the changeset viewer.