-
-
Notifications
You must be signed in to change notification settings - Fork 728
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
Benchmark combo #189
base: main
Are you sure you want to change the base?
Benchmark combo #189
Conversation
3082af4
to
06e84e6
Compare
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.
Could 3f1fc4b add tests for utils.combine
, in particular ensuring that a
and b
are not mutated? That way, if that behavior needs to change in the "new implementation" commit, that commit can also alter the tests - so that the scope of the changes is apparent.
I think the best place to let everyone know an internal change occurred is the CHANGELOG. It doesn't seem a good use of time to write a test for something which doesn't need to exist and then immediately remove that test for a new implementation. Mutation is the correct operation to append a value to an internally created and used array. That's why the Ultimately, it's your library. Feel free to test how you like and accept, revise, or reject my PR's because the library's functionality is your responsibility. I recommend you take the benchmarking out for a spin. Adapt it to compare current implementations against dev versions and try out some new stuff. For example, you may consider altering It's an adventure. Have fun. |
I'm suggesting that this lets me, the reviewer, know what changes the PR is making - and the changelog is written by manually auditing the PR. The other purpose of writing the tests is that it lets me merge in the first commit immediately, while it will take much more time for me to evaluate the rest of the PR. If you're not willing to take the time, that's entirely up to you. Querystring parsing is not a use case that requires high performance, because there's only one query string per request, so there's no urgency to accept a performance improvement - especially if it changes observable semantics by adding mutation to a code path (which is far worse a thing than "slow") Thanks for your contribution so far; I'll leave this open in case you decide to put in the time in the future. |
06e84e6
to
5a9ae1c
Compare
6688a4e
to
cb38173
Compare
@elidoran I've improved the tests and pulled the If you're still interested in seeing the performance of |
See #185 and #187
This PR applies the benchmarking stuff first. Then moves the combo stuff to the utils function with the original implementation. Then replaces it with the new implementation.
Run benchmark with
node benchmark/arraying.js
.There's a variety of ways to setup how to run benchmarking scripts as you add more. Could use npm scripts entry per each benchmark. Or, make an index file in there which accepts a subcommand for which one to run so there's only one npm run script. I leave those decisions up to you.
Adding the new implementation is last so you can peel it off from the PR if you'd like.