-
Notifications
You must be signed in to change notification settings - Fork 4.9k
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Increase size of Number's small numbers cache, and make it lazy #79061
Conversation
I couldn't figure out the best area label to add to this PR. If you have write-permissions please help me learn by adding exactly one area label. |
fb487ae
to
941ec76
Compare
src/libraries/System.Private.CoreLib/src/System/Number.Formatting.cs
Outdated
Show resolved
Hide resolved
I assume that the perf regression for |
Maybe? I'd assumed it was due to switching to the strings being lazily initialized, so there's now a null check / branch where there wasn't one for single digits. |
Yes, there is an extra conditional branch, but it should be perfectly predicted in the microbenchmark run. It is not enough to explain close to 2x slowdown. |
@BrzVlad, can you validate the interpreter changes here? This PR is replacing the cache that intrinsic was using. If there's something I should be doing instead, please let me know. |
Spoke offline with Vlad about the interpreter, and we're good to remove this hack (plan was to remove it anyway at some point soon). |
Failure is #79124 |
Fixes #76888