Skip to content

Avoid isFnAsyncResource calling task functions #370

@liuxingbaoyu

Description

@liuxingbaoyu

I upgraded TinyBench from v3 to v5 and noticed a slowdown in initialization.
After debugging, I discovered that isFnAsyncResource calls the bench function to check if it's an asynchronous task.
It would be great if this function execution could be avoided by default or if there was an option to avoid it.

    at fn (file:///F:/babel/benchmark/util.mjs:139:15)
    at isFnAsyncResource (file:///F:/babel/node_modules/tinybench/dist/index.js:1:27858)
    at new Task (file:///F:/babel/node_modules/tinybench/dist/index.js:1:29292)
    at Bench.add (file:///F:/babel/node_modules/tinybench/dist/index.js:1:35860)
    at Benchmark.add (file:///F:/babel/benchmark/util.mjs:106:16)
    at Timeout._onTimeout (file:///F:/babel/benchmark/util.mjs:172:13)
    at listOnTimeout (node:internal/timers:608:17)
    at process.processTimers (node:internal/timers:543:7)

Thanks for this amazing project!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions