Skip to content

Conversation

@rakita
Copy link
Member

@rakita rakita commented Jan 28, 2025

frame_end is called twice in this setup.

loop {
let frame = frame_stack.last_mut().unwrap();
let call_or_result = self.frame_call(frame, context, frame_context)?;
let result = match call_or_result {
ItemOrResult::Item(init) => {
match self.frame_init(frame, context, frame_context, init)? {
ItemOrResult::Item(new_frame) => {
frame_stack.push(new_frame);
continue;
}
// Dont pop the frame as new frame was not created.
ItemOrResult::Result(result) => result,
}
}
ItemOrResult::Result(result) => {
// Pop frame that returned result
frame_stack.pop();
result
}
};
let Some(frame) = frame_stack.last_mut() else {
return Ok(result);
};
self.frame_return_result(frame, context, frame_context, result)?;
}

Main execution loop will always call frame_return_result and last_frame_result so calling frame_end in those two places is enough

@codspeed-hq
Copy link

codspeed-hq bot commented Jan 28, 2025

CodSpeed Performance Report

Merging #2037 will improve performances by 2.99%

Comparing rakita/fix_inspector_frame_end (d62a8e9) with main (03f84f3)

Summary

⚡ 1 improvements
✅ 7 untouched benchmarks

Benchmarks breakdown

Benchmark BASE HEAD Change
precompile bench | ecrecover precompile 203.5 µs 197.6 µs +2.99%

@rakita rakita merged commit 249531c into main Jan 28, 2025
28 checks passed
@rakita rakita deleted the rakita/fix_inspector_frame_end branch January 28, 2025 22:14
This was referenced Mar 10, 2025
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