Skip to content

Support per-benchmark-suite setup and teardown #58488

Description

@joyeecheung

Currently with the benchmark utility, if a benchmark needs to perform setup and tear down, it can only be done on a per-run basis. A good example would be:

createEntryPoint(n);

This benchmark needs to create 10K files per-run, so for 60 runs * 3 configurations, it needs to create and delete 60 * 3 * 10K files, so the majority of the time spent on running the benchmark come from this process instead of the actual benchmarking that's done in between.

If for example we support setup and teardown on a per-suite basis (it doesn't necessarily have to be config-specific, a benchmark can do a setup for all the configs in one setup/teardown pair), then this would be reduced to only creating/deleting 3 * 10K files.

The setup/teardown should probably be done somewhere around here - before starting the queue and after executing the last job in the queue:

node/benchmark/common.js

Lines 234 to 241 in 7178588

if (queueIndex + 1 < this.queue.length) {
recursive(queueIndex + 1);
}
});
};
recursive(0);

Activity

  1. added
    benchmarkIssues and PRs related to Node.js benchmarks and benchmarking infrastructure.
    on May 28, 2025
  2. symonbaikov commented on May 29, 2025

    @symonbaikov

    I can take this one to work

  3. NitinAtIntel commented on May 29, 2025

    @NitinAtIntel

    Hey there, I've been looking for a good first issue and if help is needed I'd also be happy to collaborate.

  4. pmarchini commented on May 29, 2025

    @pmarchini
    Member

    Hey @symonbaikov, @NitinAtIntel,
    Thank you very much for your support 🚀

    Any contribution is more than welcome!

    Feel free to open a PR 😊

  5. 0hmX commented on Jul 18, 2025

    @0hmX
    Contributor

    will work on this

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    benchmarkIssues and PRs related to Node.js benchmarks and benchmarking infrastructure.

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions