Skip to content

Add options to bench profile#204

Merged
joshuajbouw merged 1 commit intodevelopfrom
cargo-profile-settings
Jul 30, 2021
Merged

Add options to bench profile#204
joshuajbouw merged 1 commit intodevelopfrom
cargo-profile-settings

Conversation

@birchmd
Copy link
Copy Markdown
Member

@birchmd birchmd commented Jul 29, 2021

Context: @joshuajbouw asked if we should set the opt-level in the dev profile to match release, for consistency. I didn't see the harm, so gave it a shot, and it turns out this is not possible because of a complex interaction between wasmer's handling of panics and the rust compiler.

This is not a big deal because the wasm binaries we use in tests are still compiled with --release; it is only the test code that consumes and runs the wasm which will not be optimized, and that does not matter because performance of test execution is not particularly important.

As a result of this issue, I learned from @matklad that we need to enable lto on the bench profile in order to actually get link time optimization when running tests with --release (because compiling with test and --release together sometimes means some crates will be compiled under bench for some reason). This is important for us because we do have benchmarks which are run as tests with --release. This is fixed in this PR. With this change, the benchmarks measuring the wall-clock performance of NEAR runtime should be more accurate.

@birchmd birchmd added the C-bug Category: Something isn't working. label Jul 29, 2021
@birchmd birchmd requested review from artob and joshuajbouw July 29, 2021 14:06
Copy link
Copy Markdown
Contributor

@joshuajbouw joshuajbouw left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Makes sense!

@mrLSD mrLSD self-requested a review July 30, 2021 09:59
@joshuajbouw joshuajbouw merged commit 622b483 into develop Jul 30, 2021
@joshuajbouw joshuajbouw deleted the cargo-profile-settings branch July 30, 2021 10:05
artob added a commit that referenced this pull request Jul 30, 2021
* JSON: fix bugs and add unit tests. (#141)
* Add storage layout debug support for `EvmErc20.sol`. (#178)
* ERC-20: forbid using invalid NEP-141 AccountID for mapping. (#179)
* Add EIP-2930 support. (#181, #182)
* Migrate all workflows to self-hosted runners. (#185)
* Speed up the workflow using build caching. (#189)
* Use the new math API host functions. (#190)
* Fix `clippy::enum_variant_names` warning. (#192)
* Add different networks to the Makefile. (#193)
* Update the network status in the README. (#194)
* Remove the toolchain installation step in workflows. (#195)
* Run all tests for all networks in CI. (#196)
* Optimize for performance instead of code size. (#197)
* Parallelize the test suites. (#198)
* Add build-caching to the testing workflow. (#201)
* Refactor tests to use Signer. (#203)
* Add options to the bench profile. (#204)
* Remove a duplicate test. (#205)
* Add a sanity test for access list handling. (#206)
* Update nearcore to the latest branch.
* Add feature gates to the SDK's new host functions.

Co-authored-by: Ahmed Ali <ahmed@aurora.dev>
Co-authored-by: Dmitry Strokov <dmitry@aurora.dev>
Co-authored-by: Evgeny Ukhanov <evgeny@aurora.dev>
Co-authored-by: Joshua J. Bouw <joshua@aurora.dev>
Co-authored-by: Kirill <kirill@aurora.dev>
Co-authored-by: Michael Birch <michael@aurora.dev>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

C-bug Category: Something isn't working.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants