Skip to content

Commit

Permalink
Fix benchmarks and no_std
Browse files Browse the repository at this point in the history
  • Loading branch information
lrubasze committed Jan 24, 2025
1 parent 0185384 commit 7526e96
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 7 deletions.
2 changes: 1 addition & 1 deletion radix-engine-tests/assets/blueprints/.cargo/config.toml
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
[build]
target = "wasm32-unknown-unknown"
target = "wasm32-unknown-unknown"
7 changes: 3 additions & 4 deletions radix-engine-tests/benches/costing.rs
Original file line number Diff line number Diff line change
Expand Up @@ -175,8 +175,7 @@ fn bench_validate_secp256k1(c: &mut Criterion) {
fn bench_spin_loop_v1(c: &mut Criterion) {
// Prepare code
let code =
wat2wasm(&include_local_wasm_str!("loop.wat").replace("${n}", &i32::MAX.to_string()))
.unwrap();
wat2wasm(&include_local_wasm_str!("loop.wat").replace("${n}", &i32::MAX.to_string()));
let mut ledger = LedgerSimulatorBuilder::new().build();
let package_address = ledger.publish_package_simple(PackagePublishingSource::PublishExisting(
code,
Expand Down Expand Up @@ -209,7 +208,7 @@ fn bench_spin_loop_v1(c: &mut Criterion) {
// There is only one instruction `br` per iteration.
// It's extremely helpful for stress testing the `consume_wasm_execution_units` host function.
fn bench_spin_loop_v2(c: &mut Criterion) {
let code = wat2wasm(&include_local_wasm_str!("loop_v2.wat")).unwrap();
let code = wat2wasm(&include_local_wasm_str!("loop_v2.wat"));
let mut ledger = LedgerSimulatorBuilder::new().build();
let package_address = ledger.publish_package_simple(PackagePublishingSource::PublishExisting(
code,
Expand Down Expand Up @@ -337,7 +336,7 @@ macro_rules! bench_instantiate {
c.bench_function(concat!("costing::instantiate_", $what), |b| {
b.iter(|| {
let wasm_engine = DefaultWasmEngine::default();
wasm_engine.instantiate(CodeHash(Hash([0u8; 32])), &instrumented_code);
wasm_engine.instantiate(CodeHash(Hash([0u8; 32])), &instrumented_code, ScryptoVmVersion::latest());
})
});

Expand Down
2 changes: 0 additions & 2 deletions radix-engine/src/vm/wasm/wasm_validator.rs
Original file line number Diff line number Diff line change
Expand Up @@ -120,8 +120,6 @@ mod tests {
)
.unwrap();

println!("{}", instrumented_code);

assert_eq!(
instrumented_code,
r#"(module
Expand Down

0 comments on commit 7526e96

Please sign in to comment.