Skip to content

Instantly share code, notes, and snippets.

@ColonelBundy
Last active September 12, 2023 15:54
Show Gist options
  • Save ColonelBundy/d57fb9cd16eb87b2d4d932acc1055b30 to your computer and use it in GitHub Desktop.
Save ColonelBundy/d57fb9cd16eb87b2d4d932acc1055b30 to your computer and use it in GitHub Desktop.

Revisions

  1. ColonelBundy revised this gist Apr 8, 2018. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion README
    Original file line number Diff line number Diff line change
    @@ -6,4 +6,4 @@ Windows_NT 10.0.16299 x64
    AMD Ryzen 7 1700 Eight-Core Processor × 16

    Conclusion:
    Callback's are faster, async/await is horrible
    Callback's takes the cake, async/await is horrible
  2. ColonelBundy revised this gist Apr 8, 2018. 2 changed files with 9 additions and 6 deletions.
    9 changes: 9 additions & 0 deletions README
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,9 @@
    Script used:
    https://github.com/kyrylkov/promise-async-performance

    Platform info:
    Windows_NT 10.0.16299 x64
    AMD Ryzen 7 1700 Eight-Core Processor × 16

    Conclusion:
    Callback's are faster, async/await is horrible
    6 changes: 0 additions & 6 deletions gistfile1.txt
    Original file line number Diff line number Diff line change
    @@ -1,6 +0,0 @@
    Script used:
    https://github.com/kyrylkov/promise-async-performance

    Platform info:
    Windows_NT 10.0.16299 x64
    AMD Ryzen 7 1700 Eight-Core Processor × 16
  3. ColonelBundy revised this gist Apr 8, 2018. 3 changed files with 0 additions and 1 deletion.
    File renamed without changes.
    File renamed without changes.
    1 change: 0 additions & 1 deletion gistfile1.txt
    Original file line number Diff line number Diff line change
    @@ -3,5 +3,4 @@ https://github.com/kyrylkov/promise-async-performance

    Platform info:
    Windows_NT 10.0.16299 x64
    V8 6.1.534.50
    AMD Ryzen 7 1700 Eight-Core Processor × 16
  4. ColonelBundy revised this gist Apr 8, 2018. 3 changed files with 8 additions and 6 deletions.
    1 change: 1 addition & 0 deletions Node.JS 8.9.4
    Original file line number Diff line number Diff line change
    @@ -1,3 +1,4 @@

    Doxbee sequential
    benchmarking ./doxbee-sequential/async-bluebird.js
    {"time":428,"mem":60.38671875,"errors":0,"lastErr":null}
    6 changes: 0 additions & 6 deletions Node.JS 9.11.1
    Original file line number Diff line number Diff line change
    @@ -57,9 +57,3 @@ async-es2017-util.promisify.js 1029 195.85
    promises-es2015-util.promisify.js 1073 184.84
    promises-es2015-native.js 1300 300.89
    async-es2017-native.js 1420 312.76

    Platform info:
    Windows_NT 10.0.16299 x64
    Node.JS 9.11.1
    V8 6.2.414.46-node.23
    AMD Ryzen 7 1700 Eight-Core Processor × 16
    7 changes: 7 additions & 0 deletions gistfile1.txt
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,7 @@
    Script used:
    https://github.com/kyrylkov/promise-async-performance

    Platform info:
    Windows_NT 10.0.16299 x64
    V8 6.1.534.50
    AMD Ryzen 7 1700 Eight-Core Processor × 16
  5. ColonelBundy created this gist Apr 8, 2018.
    66 changes: 66 additions & 0 deletions Node.JS 8.9.4
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,66 @@
    Doxbee sequential
    benchmarking ./doxbee-sequential/async-bluebird.js
    {"time":428,"mem":60.38671875,"errors":0,"lastErr":null}
    benchmarking ./doxbee-sequential/async-es2017-native.js
    {"time":591,"mem":98.82421875,"errors":0,"lastErr":null}
    benchmarking ./doxbee-sequential/async-es2017-util.promisify.js
    {"time":479,"mem":69.7734375,"errors":0,"lastErr":null}
    benchmarking ./doxbee-sequential/callbacks-baseline.js
    {"time":149,"mem":29.99609375,"errors":0,"lastErr":null}
    benchmarking ./doxbee-sequential/promises-bluebird-generator.js
    {"time":267,"mem":40.62109375,"errors":0,"lastErr":null}
    benchmarking ./doxbee-sequential/promises-bluebird.js
    {"time":329,"mem":49.48046875,"errors":0,"lastErr":null}
    benchmarking ./doxbee-sequential/promises-es2015-native.js
    {"time":560,"mem":90.82421875,"errors":0,"lastErr":null}
    benchmarking ./doxbee-sequential/promises-es2015-util.promisify.js
    {"time":513,"mem":71.2734375,"errors":0,"lastErr":null}

    results for 10000 parallel executions, 1 ms per I/O op

    file time(ms) memory(MB)
    callbacks-baseline.js 149 30.00
    promises-bluebird-generator.js 267 40.62
    promises-bluebird.js 329 49.48
    async-bluebird.js 428 60.39
    async-es2017-util.promisify.js 479 69.77
    promises-es2015-util.promisify.js 513 71.27
    promises-es2015-native.js 560 90.82
    async-es2017-native.js 591 98.82


    Madeup parallel
    benchmarking ./madeup-parallel/async-bluebird.js
    {"time":597,"mem":115.71875,"errors":0,"lastErr":null}
    benchmarking ./madeup-parallel/async-es2017-native.js
    {"time":2056,"mem":317.40234375,"errors":0,"lastErr":null}
    benchmarking ./madeup-parallel/async-es2017-util.promisify.js
    {"time":1421,"mem":201.40625,"errors":0,"lastErr":null}
    benchmarking ./madeup-parallel/callbacks-baseline.js
    {"time":371,"mem":74.2578125,"errors":0,"lastErr":null}
    benchmarking ./madeup-parallel/promises-bluebird-generator.js
    {"time":604,"mem":111.328125,"errors":0,"lastErr":null}
    benchmarking ./madeup-parallel/promises-bluebird.js
    {"time":564,"mem":106.125,"errors":0,"lastErr":null}
    benchmarking ./madeup-parallel/promises-es2015-native.js
    {"time":1762,"mem":305.1484375,"errors":0,"lastErr":null}
    benchmarking ./madeup-parallel/promises-es2015-util.promisify.js
    {"time":1314,"mem":192.19921875,"errors":0,"lastErr":null}

    results for 10000 parallel executions, 1 ms per I/O op

    file time(ms) memory(MB)
    callbacks-baseline.js 371 74.26
    promises-bluebird.js 564 106.13
    async-bluebird.js 597 115.72
    promises-bluebird-generator.js 604 111.33
    promises-es2015-util.promisify.js 1314 192.20
    async-es2017-util.promisify.js 1421 201.41
    promises-es2015-native.js 1762 305.15
    async-es2017-native.js 2056 317.40

    Platform info:
    Windows_NT 10.0.16299 x64
    Node.JS 8.9.4
    V8 6.1.534.50
    AMD Ryzen 7 1700 Eight-Core Processor × 16
    65 changes: 65 additions & 0 deletions Node.JS 9.11.1
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,65 @@
    Doxbee sequential
    benchmarking ./doxbee-sequential/async-bluebird.js
    {"time":363,"mem":57.234375,"errors":0,"lastErr":null}
    benchmarking ./doxbee-sequential/async-es2017-native.js
    {"time":413,"mem":93.171875,"errors":0,"lastErr":null}
    benchmarking ./doxbee-sequential/async-es2017-util.promisify.js
    {"time":382,"mem":65.4609375,"errors":0,"lastErr":null}
    benchmarking ./doxbee-sequential/callbacks-baseline.js
    {"time":152,"mem":25.5625,"errors":0,"lastErr":null}
    benchmarking ./doxbee-sequential/promises-bluebird-generator.js
    {"time":248,"mem":36.40625,"errors":0,"lastErr":null}
    benchmarking ./doxbee-sequential/promises-bluebird.js
    {"time":251,"mem":46.23828125,"errors":0,"lastErr":null}
    benchmarking ./doxbee-sequential/promises-es2015-native.js
    {"time":413,"mem":89.1015625,"errors":0,"lastErr":null}
    benchmarking ./doxbee-sequential/promises-es2015-util.promisify.js
    {"time":436,"mem":63.33203125,"errors":0,"lastErr":null}

    results for 10000 parallel executions, 1 ms per I/O op

    file time(ms) memory(MB)
    callbacks-baseline.js 152 25.56
    promises-bluebird-generator.js 248 36.41
    promises-bluebird.js 251 46.24
    async-bluebird.js 363 57.23
    async-es2017-util.promisify.js 382 65.46
    async-es2017-native.js 413 93.17
    promises-es2015-native.js 413 89.10
    promises-es2015-util.promisify.js 436 63.33

    Madeup parallel
    benchmarking ./madeup-parallel/async-bluebird.js
    {"time":445,"mem":109.73046875,"errors":0,"lastErr":null}
    benchmarking ./madeup-parallel/async-es2017-native.js
    {"time":1420,"mem":312.7578125,"errors":0,"lastErr":null}
    benchmarking ./madeup-parallel/async-es2017-util.promisify.js
    {"time":1029,"mem":195.8515625,"errors":0,"lastErr":null}
    benchmarking ./madeup-parallel/callbacks-baseline.js
    {"time":298,"mem":73.140625,"errors":0,"lastErr":null}
    benchmarking ./madeup-parallel/promises-bluebird-generator.js
    {"time":502,"mem":104.19921875,"errors":0,"lastErr":null}
    benchmarking ./madeup-parallel/promises-bluebird.js
    {"time":455,"mem":103.63671875,"errors":0,"lastErr":null}
    benchmarking ./madeup-parallel/promises-es2015-native.js
    {"time":1300,"mem":300.89453125,"errors":0,"lastErr":null}
    benchmarking ./madeup-parallel/promises-es2015-util.promisify.js
    {"time":1073,"mem":184.8359375,"errors":0,"lastErr":null}

    results for 10000 parallel executions, 1 ms per I/O op

    file time(ms) memory(MB)
    callbacks-baseline.js 298 73.14
    async-bluebird.js 445 109.73
    promises-bluebird.js 455 103.64
    promises-bluebird-generator.js 502 104.20
    async-es2017-util.promisify.js 1029 195.85
    promises-es2015-util.promisify.js 1073 184.84
    promises-es2015-native.js 1300 300.89
    async-es2017-native.js 1420 312.76

    Platform info:
    Windows_NT 10.0.16299 x64
    Node.JS 9.11.1
    V8 6.2.414.46-node.23
    AMD Ryzen 7 1700 Eight-Core Processor × 16