Skip to content
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

feat: add Bencher::iter_with_setup_wrapper #49

Merged
merged 1 commit into from
Aug 27, 2024

Conversation

overlookmotel
Copy link
Contributor

@overlookmotel overlookmotel commented Aug 25, 2024

Add Bencher::iter_with_setup_wrapper. This API allows setup to be performed before each iteration of the benchmark, and the setup and routine functions can mutably borrow values from outside their closures.

This enables us to benchmark Oxc's components in isolation e.g. oxc-project/oxc#5193.

@Boshen Boshen force-pushed the iter-with-setup-wrapper branch from 343a49d to 0184f71 Compare August 26, 2024 08:51
@Boshen Boshen merged commit 1b2d336 into Boshen:main Aug 27, 2024
5 checks passed
@Boshen Boshen mentioned this pull request Aug 27, 2024
Boshen added a commit that referenced this pull request Aug 27, 2024
## 🤖 New release
* `criterion2`: 1.0.0 -> 1.1.0

<details><summary><i><b>Changelog</b></i></summary><p>

<blockquote>

##
[1.1.0](v1.0.0...v1.1.0)
- 2024-08-27

### Added
- add `Bencher::iter_with_setup_wrapper`
([#49](#49))

### Fixed
- fix integration tests not being run
</blockquote>


</p></details>

---
This PR was generated with
[release-plz](https://github.com/MarcoIeni/release-plz/).
Boshen pushed a commit to oxc-project/oxc that referenced this pull request Aug 27, 2024
Transformer benchmark measure only the transformer itself. Parse, generate `Semantic`, and drop `Semantic` outside of the measured section.

This should:

1. Give us greater visibility of how changes to transformer affect its performance.
2. Reduce variance in transformer benchmarks, since they will no longer include the variance introduced by `SemanticBuilder`.

Not ready to merge yet. We should first add an "end to end" benchmark testing the entire compilation process (parse - semantic - transform - minify - codegen).

This PR depends on Boshen/criterion2.rs#49. This PR currently makes Oxc's dependency on `criterion2` a git dependency on that PR's branch. That can be changed once the upstream PR is merged.
@overlookmotel overlookmotel deleted the iter-with-setup-wrapper branch December 22, 2024 14:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants