BackburnerJS / backburner.js

A rewrite of the Ember.js run loop as a generic microlibrary
MIT License
392 stars 80 forks source link

Wasm compilation using assemblyscript #342

Open lifeart opened 6 years ago

lifeart commented 6 years ago

I'm wondering how fast if can be, using https://github.com/AssemblyScript/assemblyscript

lifeart commented 6 years ago

Notable observation:

tsconfig "strictNullChecks": true,

running first test, please wait...
  Debounce - function ................................................................ 108,658.49 op/s
  Debounce & Cancel - function, target ................................................ 97,818.38 op/s
  Later & Cancel - function .......................................................... 102,731.83 op/s
  Later & Cancel - function, target .................................................. 118,602.50 op/s
  Schedule & Cancel - function ..................................................... 2,188,191.57 op/s
  Schedule & Cancel - target, function ............................................... 944,178.22 op/s
  Schedule & Cancel - target, string method name ..................................... 907,100.24 op/s
  Schedule & Cancel - target, string method name, 1 argument ......................... 809,899.71 op/s
  Schedule & Cancel - target, string method name, 2 arguments ........................ 861,178.51 op/s
  Schedule & Cancel - prescheduled, same queue - target, string method name .......... 428,491.87 op/s
  Schedule & Cancel - prescheduled, separate queue - target, string method name ...... 559,144.99 op/s
  Schedule & Flush - function ........................................................ 197,760.12 op/s
  Schedule & Flush - target, function ................................................ 214,655.55 op/s
  Schedule & Flush - target, string method name ...................................... 192,407.71 op/s
  Schedule & Flush - target, string method name, 1 argument .......................... 172,177.68 op/s
  Schedule & Flush - target, string method name, 2 arguments ......................... 191,193.17 op/s
  DEBUG - Schedule & Flush - function ................................................. 93,005.91 op/s
  DEBUG - Schedule & Flush - target, function ......................................... 85,276.09 op/s
  DEBUG - Schedule & Flush - target, string method name ............................... 88,527.90 op/s
  DEBUG - Schedule & Flush - target, string method name, 1 argument ................... 90,712.66 op/s
  DEBUG - Schedule & Flush - target, string method name, 2 arguments .................. 89,684.43 op/s
  Throttle - function .............................................................. 1,950,637.30 op/s
  Throttle & Cancel - function, target ............................................... 717,488.30 op/s
fastest: Schedule & Cancel - function

no strictNullChecks

running first test, please wait...
  Debounce - function ................................................................. 91,996.18 op/s
  Debounce & Cancel - function, target ................................................ 82,458.62 op/s
  Later & Cancel - function ........................................................... 86,150.42 op/s
  Later & Cancel - function, target ................................................... 77,079.13 op/s
  Schedule & Cancel - function ..................................................... 1,831,791.27 op/s
  Schedule & Cancel - target, function ............................................... 834,059.89 op/s
  Schedule & Cancel - target, string method name ..................................... 636,055.90 op/s
  Schedule & Cancel - target, string method name, 1 argument ......................... 630,757.75 op/s
  Schedule & Cancel - target, string method name, 2 arguments ........................ 610,234.78 op/s
  Schedule & Cancel - prescheduled, same queue - target, string method name .......... 454,164.94 op/s
  Schedule & Cancel - prescheduled, separate queue - target, string method name ...... 849,184.12 op/s
  Schedule & Flush - function ........................................................ 186,936.43 op/s
  Schedule & Flush - target, function ................................................ 211,149.38 op/s
  Schedule & Flush - target, string method name ...................................... 202,991.20 op/s
  Schedule & Flush - target, string method name, 1 argument .......................... 166,574.96 op/s
  Schedule & Flush - target, string method name, 2 arguments ......................... 191,791.21 op/s
  DEBUG - Schedule & Flush - function ................................................. 82,968.55 op/s
  DEBUG - Schedule & Flush - target, function ......................................... 89,729.08 op/s
  DEBUG - Schedule & Flush - target, string method name ............................... 92,334.04 op/s
  DEBUG - Schedule & Flush - target, string method name, 1 argument ................... 84,895.56 op/s
  DEBUG - Schedule & Flush - target, string method name, 2 arguments .................. 90,265.15 op/s
  Throttle - function .............................................................. 1,881,828.55 op/s
  Throttle & Cancel - function, target ............................................... 564,524.48 op/s
fastest: Throttle - function,Schedule & Cancel - function