Skip to content

perf: reduce binary size by optimizing panic formatting - #536

Open
fereidani wants to merge 1 commit into
servo:v2from
fereidani:v2_cold_panic
Open

perf: reduce binary size by optimizing panic formatting#536
fereidani wants to merge 1 commit into
servo:v2from
fereidani:v2_cold_panic

Conversation

@fereidani

Copy link
Copy Markdown
Contributor

This PR reduces binary size of users by avoiding inlining of rarely executed panic formatting code, methodology is exactly the same as what is used in rust standard library.

#[cold] hint is also expected to improve the performance slightly by marking panic path unlikely for the compiler.

@alejandro-vaz

Copy link
Copy Markdown
Collaborator

what improvements do the benchmarks show??

I'm a bit afraid of these types of changes because they bloat the codebase a lot

is there any way we can extract all those assert_failed into a common helper with a generic message or an enum dispatch??

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