Skip to content
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

Don't include <algorithm> in <chrono> #3626

Merged

Conversation

frederick-vs-ja
Copy link
Contributor

Separated from #3623. Towards #3599.

It seems to me that we don't need to use transform for tzdb_list. emplace_back in loop looks better.

@frederick-vs-ja frederick-vs-ja requested a review from a team as a code owner April 5, 2023 07:23
Copy link
Contributor

@strega-nil-ms strega-nil-ms left a comment

Choose a reason for hiding this comment

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

This is a good change, imo.

@strega-nil-ms strega-nil-ms added the throughput Must compile faster label Apr 5, 2023
@StephanTLavavej
Copy link
Member

Agreed! Even without the throughput considerations, this is more efficient and easier to understand. The reserve() calls are safe (note that careless use of reserve() can lead to quadratic complexity, but not in the pattern here.)

I checked all of <chrono>'s _STD calls, and I see no other <algorithm> dependencies. We're using _Copy_unchecked, fill, find_if, and upper_bound from <xutility>, as they are widely needed.

Finally, this is unlikely to be an impactful breaking change, as it's limited to C++20.

@StephanTLavavej StephanTLavavej self-assigned this Apr 7, 2023
@StephanTLavavej
Copy link
Member

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

@StephanTLavavej StephanTLavavej merged commit 7eeef47 into microsoft:main Apr 7, 2023
@StephanTLavavej
Copy link
Member

Thanks for finding and making this major improvement! <algorithm> is huge so this should be a nice win. 🎉 📉 😻

@frederick-vs-ja frederick-vs-ja deleted the throughput-chrono-transform branch April 8, 2023 05:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
throughput Must compile faster
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants