-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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
Fewer allocations to put smaller bitset to stream #4818
Conversation
Can go furthr and convert to digit array by parts, and stream those parts, this way can avoid sllocations altogether. But this would be more complex change |
I think this is plenty - large bitsets are increasingly uncommon, and anyone touching iostreams isn't going to have great perf in the first place. |
Well, |
I'm mirroring this to the MSVC-internal repo - please notify me if any further changes are pushed. |
Thanks for letting the allocator take some vacation days! 🏖️ 🥳 😹 |
The value of 128 bytes is arbitrary, could be greater if we are brave.
I kept variable
_Len
as opposer to_Bits
constant, as constant propagation apparently engages a very harmful optimization.Didn't benchmark precisely output to stream, I think if falls under "definitely good" category; if not, I can add, but then will need to wait for #4817