Skip to content

Cache _Fmt_codec<char, false> - #2600

Merged
Stephan T. Lavavej (StephanTLavavej) merged 1 commit into
microsoft:mainfrom
cpplearner:patch-1
Mar 28, 2022
Merged

Stephan T. Lavavej (StephanTLavavej) merged 1 commit into
microsoft:mainfrom
cpplearner:patch-1

Conversation

@cpplearner

@cpplearner S. B. Tam (cpplearner) commented Mar 1, 2022

Copy link
Copy Markdown
Contributor

This is an alternative to #2596.

Fixes #2594

I thought of simply returning a global _Fmt_codec<char> object in _Get_fmt_codec<char>(), but I think this might make std::format unusable in initialization of variable template instances. (The standard says that such initializations are unordered with other initializations.)

@cpplearner
S. B. Tam (cpplearner) requested a review from a team as a code owner March 1, 2022 14:17
Comment thread stl/inc/format Outdated
Comment thread stl/inc/chrono
@barcharcraz

This comment was marked as resolved.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks great to me, though someone who understands more about object lifetime should look at the caching component.

Comment thread stl/inc/format
@StephanTLavavej

This comment was marked as resolved.

@StephanTLavavej Stephan T. Lavavej (StephanTLavavej) removed the blocked Something is preventing work on this label Mar 19, 2022
@StephanTLavavej

This comment was marked as resolved.

Comment thread stl/inc/format
@StephanTLavavej

Copy link
Copy Markdown
Member

I'm mirroring this to the MSVC-internal repo - please notify me if any further changes are pushed.

@StephanTLavavej
Stephan T. Lavavej (StephanTLavavej) merged commit f307b76 into microsoft:main Mar 28, 2022
@StephanTLavavej

Copy link
Copy Markdown
Member

Thanks for improving <format> performance with these codepages! 🚀 ⚡ 🚅

@cpplearner
S. B. Tam (cpplearner) deleted the patch-1 branch May 7, 2022 09:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

format C++20/23 format performance Must go faster

Projects

None yet

Development

Successfully merging this pull request may close these issues.

<format>: Could the output of __std_get_cvt be cached?

6 participants