-
-
Notifications
You must be signed in to change notification settings - Fork 743
Add comprehensive benchmarking suite #527
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
|
Review the following changes in direct dependencies. Learn more about Socket for GitHub.
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
the root package.json's publishConfig.ignore will need "benchmark" added in package.json as well.
Also, can we add a GHA workflow that runs these on every push/PR, and fails if there's a big enough slowdown?
|
I added most of the comments, will find a way for the GHA @ljharb |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this seems to be only running benchmarks in node 20.
what versions should it run on ? |
all of them |
|
Currently, the benchmarking scripts use some modern features (e.g., Array.from, async/await) and rely on tools that are not compatible with 0.8 like Benchmark.js which I use for benchmarking, which only supports node 0.10. So, is compatibility with Node 0.8 for the benchmarking infrastructure is a hard requirement ? @ljharb |
|
I can definitely live with only going down to 0.10. https://npmjs.com/array.from should cover that one, and async/await can be done with Promises instead, which are polyfillable. |
- Implemented parsing benchmarks for various query string formats including simple, nested, and array queries. - Added stringifying benchmarks for different object structures and array formats. - Created a runner to manage benchmark execution and results reporting. - Introduced fixtures for generating test data patterns for benchmarking. - Added functionality to compare current results against baseline benchmarks. - Implemented options for saving current results as baseline and generating summary reports. - Enhanced command-line interface for running benchmarks with various options.
… query retrieval logic
- Deleted outdated benchmark result files to clean up the repository. - Updated the `generateQuery` function in fixtures to handle default size parameter more gracefully. - Added new dependencies for polyfills to support ES6+ features in older Node.js versions. - Removed custom polyfills for Array.from, String.prototype.repeat, Object.fromEntries, and Object.entries, replacing them with well-maintained npm packages. - Updated benchmark runner to improve code readability and maintainability. - Adjusted benchmark commands in package.json for consistency and clarity. - Added new benchmark result file with updated performance metrics for various parsing scenarios.
This reverts commit eb599f5.
…ssignment and change arrow functions to regular functions
|
Hi @ljharb |
Motivation
As discussed here #526 for prformance optimiztions, that there should be a benchmarking infrastructure:
• Execute on every Node.js version in the test matrix
• Prevent future performance regressions
• Provide data-driven evidence for performance claims