-
Notifications
You must be signed in to change notification settings - Fork 13k
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
Stop zeroing out the scratch buffer in float_to_decimal_common #41259
Comments
Link to the code in question. IMO we should start using cc @rust-lang/libs |
Is there a concrete performance issue that this is proposing to tackle? I would like to avoid moving from use of initialized to uninitialized memory "just because". |
@sfackler It came up in a Servo profile. But regardless, I would like to use safe abstractions over partial initialization of stack arrays, to better represent the semantics involved. |
Yes. The zeroing out was about 5% of the time taken in a "get the specified value of Or another way to think of it is that it's 15% of the time Safari takes to execute the entire operation. ;) |
Cool, seems worth fixing then 👍 |
float_to_decimal_common in src/libcore/fmt/float.rs does this:
which zeroes out the big buffer. Given that it's a scratch buffer, there shouldn't be a reason to do that, I would think.
The text was updated successfully, but these errors were encountered: