mirror of
https://github.com/pezkuwichain/wasm-instrument.git
synced 2026-04-29 20:38:06 +00:00
Add benchmarks and add tiny performance improvements (#6)
* Add some benchmarks * Replace extend -> extend_from_slice (1-2% performance improvement) * Add many_blocks benchmarks
This commit is contained in:
committed by
GitHub
parent
184b3f8b3a
commit
8291876394
@@ -286,7 +286,7 @@ fn instrument_function(ctx: &mut Context, func: &mut Instructions) -> Result<(),
|
||||
ctx.stack_height_global_idx(),
|
||||
ctx.stack_limit()
|
||||
);
|
||||
new_instrs.extend(new_seq);
|
||||
new_instrs.extend_from_slice(&new_seq);
|
||||
true
|
||||
} else {
|
||||
false
|
||||
|
||||
@@ -82,7 +82,7 @@ pub fn generate_thunks(
|
||||
for (arg_idx, _) in thunk.signature.params().iter().enumerate() {
|
||||
thunk_body.push(elements::Instruction::GetLocal(arg_idx as u32));
|
||||
}
|
||||
thunk_body.extend(instrumented_call.iter().cloned());
|
||||
thunk_body.extend_from_slice(&instrumented_call);
|
||||
thunk_body.push(elements::Instruction::End);
|
||||
|
||||
// TODO: Don't generate a signature, but find an existing one.
|
||||
|
||||
Reference in New Issue
Block a user