| 44 | * @param {import('tinybench').Bench} bench |
| 45 | */ |
| 46 | export default function register(bench) { |
| 47 | for (const n of [1, 5, 20]) { |
| 48 | const hook = makeHook(n, "sync"); |
| 49 | bench.add(`async-parallel-hook: ${n} sync taps`, () => runBatch(hook)); |
| 50 | } |
| 51 | |
| 52 | for (const n of [5, 20]) { |
| 53 | const hook = makeHook(n, "async"); |
| 54 | bench.add(`async-parallel-hook: ${n} async taps`, () => runBatch(hook)); |
| 55 | } |
| 56 | |
| 57 | { |
| 58 | const hook = makeHook(5, "promise"); |
| 59 | bench.add("async-parallel-hook: 5 promise taps", () => runBatch(hook)); |
| 60 | } |
| 61 | } |