Landing: 9c40d80365f3

Project / Subsystem

gcc / libstdc++

Date

2026-08-30

Author

Anlai Lu

Commit

9c40d80365f334e01f6e864e62ca9965841774cb

Source

github

Perf win

Yes

Breaking

No

All attributes

project
gcc
subsystem
libstdc++
patch_id
—
commit_hash
9c40d80365f334e01f6e864e62ca9965841774cb
source_type
github
headline
libstdc++: Skip locale in chrono operator<< for integer seconds precision
tldr
Optimizes chrono time_point formatting by skipping locale for integer-second precision, improving performance and reducing complexity.
author
Anlai Lu
outcome
committed
performance_win
true
breaking_change
false
series_id
—
series_parts
[]
tags
  • • libstdc++
  • • chrono
  • • performance
  • • locale
discussion_id_link
—
bugzilla_pr
—
date
2026-08-30T00:00:00.000Z

This commit refactors libstdc++’s chrono time formatting to improve efficiency when dealing with time points that have integer second precision. For such cases, locale-dependent formatting is unnecessary, so the code now conditionally skips the locale argument. This change eliminates a specific locale overload and simplifies initialization, while also including a minor inlining optimization for a helper function.