Skip to content

Conversation

@statementreply
Copy link
Contributor

@statementreply statementreply commented Nov 7, 2025

  1. Reduce the fraction (using std::ratio).
  2. Swap _Ctr and period::den when evaluating the mul-div to make better use of the constants.

@statementreply statementreply requested a review from a team as a code owner November 7, 2025 14:37
@github-project-automation github-project-automation bot moved this to Initial Review in STL Code Reviews Nov 7, 2025
@AlexGuteniev
Copy link
Contributor

Is compiler unable to do this on its own?

@statementreply statementreply changed the title <__msvc_chrono.hpp>: Optimize 24 MHz to nanoseconds conversion <__msvc_chrono.hpp>: Optimize 24 MHz to nanoseconds conversion in steady_clock::now Nov 7, 2025
@AlexGuteniev
Copy link
Contributor

Is compiler unable to do this on its own?

I guess yes https://godbolt.org/z/beqxjEces

@StephanTLavavej StephanTLavavej added performance Must go faster ARM64 Related to the ARM64 architecture labels Nov 7, 2025
@StephanTLavavej StephanTLavavej moved this from Initial Review to Ready To Merge in STL Code Reviews Nov 7, 2025
@StephanTLavavej StephanTLavavej moved this from Ready To Merge to Merging in STL Code Reviews Nov 11, 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 e98de6d into microsoft:main Nov 12, 2025
41 checks passed
@github-project-automation github-project-automation bot moved this from Merging to Done in STL Code Reviews Nov 12, 2025
@StephanTLavavej
Copy link
Member

2️⃣ 4️⃣ ⏱️

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

Labels

ARM64 Related to the ARM64 architecture performance Must go faster

Projects

Archived in project

Development

Successfully merging this pull request may close these issues.

3 participants