mirror of
https://github.com/pezkuwichain/revive.git
synced 2026-06-19 13:21:03 +00:00
Implement resolc end-to-end compilation benchmarks (#406)
# Description Closes [#403](https://github.com/paritytech/revive/issues/403) Adds compilation time benchmarks for resolc end-to-end. The benchmarks can be run from the root via: ```sh make bench-resolc ``` HTML reports will be generated under `target/criterion`, and a summary of the results at [crates/resolc/BENCHMARKS_M4PRO.md](https://github.com/paritytech/revive/blob/lj/compilation-benchmarks/crates/resolc/BENCHMARKS_M4PRO.md) (currently from running on a Mac M4 Pro).
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
//! The tests for running resolc with explicit optimization.
|
||||
|
||||
use crate::tests::cli::utils::{
|
||||
self, assert_command_failure, assert_command_success, assert_equal_exit_codes, execute_resolc,
|
||||
use crate::cli_utils::{
|
||||
assert_command_failure, assert_command_success, assert_equal_exit_codes, execute_resolc,
|
||||
execute_solc, RESOLC_YUL_FLAG, SOLIDITY_CONTRACT_PATH, SOLIDITY_LARGE_DIV_REM_CONTRACT_PATH,
|
||||
YUL_MEMSET_CONTRACT_PATH,
|
||||
};
|
||||
@@ -13,7 +13,7 @@ fn runs_with_valid_level() {
|
||||
for level in LEVELS {
|
||||
let optimization_argument = format!("-O{level}");
|
||||
let arguments = &[YUL_MEMSET_CONTRACT_PATH, "--yul", &optimization_argument];
|
||||
let resolc_result = utils::execute_resolc(arguments);
|
||||
let resolc_result = execute_resolc(arguments);
|
||||
assert!(
|
||||
resolc_result.success,
|
||||
"Providing the level `{optimization_argument}` should succeed with exit code {}, got {}.\nDetails: {}",
|
||||
@@ -63,7 +63,7 @@ fn test_large_div_rem_expansion() {
|
||||
for level in LEVELS {
|
||||
let optimization_argument = format!("-O{level}");
|
||||
let arguments = &[SOLIDITY_LARGE_DIV_REM_CONTRACT_PATH, &optimization_argument];
|
||||
let resolc_result = utils::execute_resolc(arguments);
|
||||
let resolc_result = execute_resolc(arguments);
|
||||
assert!(
|
||||
resolc_result.success,
|
||||
"Providing the level `{optimization_argument}` should succeed with exit code {}, got {}.\nDetails: {}",
|
||||
|
||||
Reference in New Issue
Block a user