This guide provides the steps required to clone the repository, install dependencies, and run the benchmark tests on your own machine.
- Node.js: Version 20.x or later is recommended.
- Git: Required to clone the repository.
- Operating System: The tests are designed to be run on macOS, Linux, or Windows.
First, clone the repository to your local machine:
git clone https://github.com/neomjs/benchmarks.git
cd benchmarksNext, run the setup script to install all nested dependencies and build the Neo.mjs applications:
npm run setupThe benchmarks should be executed using the npm scripts defined in package.json.
By default, each benchmark suite is run 5 times to gather multiple samples. You can override this by passing a --runs flag after the npm command.
Run the full benchmark suite for all frameworks (5 runs each):
npm run benchmark:accurate:allNote: Running
benchmark:accurate:allcan take multiple hours to complete. For local development and testing, it is recommended to use more targeted benchmark scripts (e.g.,npm run benchmark:accurate:neo).
Run all benchmark suites for Neo.mjs:
npm run benchmark:accurate:neoRun only the "scrolling" suite for Angular for a single run:
npm run benchmark:accurate:angular-scrolling -- --runs=1Run the "big-data" tests for React (defaults to 5 runs):
npm run benchmark:accurate:react-big-dataAfter the test runs are complete, the raw JSON results are stored in the test-results-data directory.
To generate human-readable markdown reports, use the corresponding npm scripts.
Generate a combined report for all benchmark results:
npm run benchmark:generate-report:combinedGenerate the report for only the Neo.mjs interactive benchmarks:
npm run benchmark:generate-report:neoGenerate the report for the React big data benchmarks:
npm run benchmark:generate-report:react-big-dataThe generated reports will be saved as markdown files in the project's root directory (e.g., BENCHMARK_RESULTS_NEO.md, COMBINED_BENCHMARK_REPORT.md).