-
Notifications
You must be signed in to change notification settings - Fork 8.3k
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 a conhost binary size regression due to fmt #11727
Conversation
// A valid response always starts with DCS 1 $ r. | ||
// Then the '0' parameter is to reset the SGR attributes to the defaults. | ||
std::wstring response = L"\033P1$r0"; | ||
fmt::basic_memory_buffer<wchar_t, 64> response; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
is 64 long enough?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah I was counting with each number being 2 digits and all parameters present and I got 56 chars.
For comparison: std::wstring
comes equipped with a whopping 7 chars for the SSO buffer (despite being 32 bytes large).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nice!
Hello @lhecker! Because this pull request has the Do note that I've been instructed to only help merge pull requests of this repository that have been opened for at least 8 hours, a condition that will be fulfilled in about 7 hours 39 minutes. No worries though, I will be back when the time is right! 😉 p.s. you can customize the way I help with merging this pull request, such as holding this pull request until a specific person approves. Simply @mention me (
|
@msftbot merge this in 8 minutes |
Hello @DHowett! Because you've given me some instructions on how to help merge this pull request, I'll be modifying my merge approach. Here's how I understand your requirements for merging this pull request:
If this doesn't seem right to you, you can tell me to cancel these instructions and use the auto-merge policy that has been configured for this repository. Try telling me "forget everything I just told you". |
🎉 Handy links: |
6140fd9 causes a binary size regression in conhost.
This PR fixes most if not all of the regression, by replacing
FMT_STRING
with
FMT_COMPILE
allowing us to drop most of the formatters builtinto fmt during linking (for instance floating point formatters).
Additionally
std::wstring
was replaced withfmt::basic_memory_buffer
in the same vein as was done for VtEngine. Stack is
cheap and this prevents any unnecessary allocations.
PR Checklist
Validation Steps Performed