This is a comparison of two functions that sum up all the integer numbers from 1 to n
and returns that sum.
$ deno test --allow-read add.ts
Check file:///home/wperron/github.com/wperron/gists/add/add.ts
running 4 benchmarks ...
benchmark add ...
1001 runs avg: 31.842157842157842ms
benchmark recursive ...
1002 runs avg: 306.2614770459082ms
benchmark reduce ...
1003 runs avg: 309.7308075772682ms
benchmark wasm ...
1004 runs avg: 0.49203187250996017ms