KEMBAR78
Use `lower_bound` instead of `find_if` to lookup `time_zone`s. by YexuanXiao · Pull Request #5548 · microsoft/STL · GitHub
Skip to content

Conversation

@YexuanXiao
Copy link
Contributor

Fix #5547.

@YexuanXiao YexuanXiao requested a review from a team as a code owner May 27, 2025 01:29
@github-project-automation github-project-automation bot moved this to Initial Review in STL Code Reviews May 27, 2025
@AlexGuteniev

This comment was marked as resolved.

@YexuanXiao

This comment was marked as resolved.

@StephanTLavavej StephanTLavavej self-assigned this May 27, 2025
@StephanTLavavej StephanTLavavej added performance Must go faster chrono C++20 chrono labels May 27, 2025
@StephanTLavavej
Copy link
Member

Thanks! 😻 On my 5950X this results in an excellent 6.7x speedup, as I have 477 zones and 157 links:

Benchmark Before After Speedup
locate_zone 135443 ns 20203 ns 6.70

@StephanTLavavej StephanTLavavej removed their assignment May 28, 2025
@StephanTLavavej StephanTLavavej moved this from Initial Review to Ready To Merge in STL Code Reviews May 28, 2025
@StephanTLavavej StephanTLavavej moved this from Ready To Merge to Merging in STL Code Reviews May 28, 2025
@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 fa1448d into microsoft:main May 28, 2025
48 checks passed
@github-project-automation github-project-automation bot moved this from Merging to Done in STL Code Reviews May 28, 2025
@StephanTLavavej
Copy link
Member

🌏 🕥 🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

chrono C++20 chrono performance Must go faster

Projects

Archived in project

Development

Successfully merging this pull request may close these issues.

<chrono>: std::chrono::locate_zone should use binary search

4 participants