Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(Inspector): frame_end called multiple times #2037

Merged
merged 1 commit into from
Jan 28, 2025

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

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
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.

1 participant