https://gcc.gnu.org/bugzilla/show_bug.cgi?id=116110
--- Comment #21 from GCC Commits <cvs-commit at gcc dot gnu.org> --- The master branch has been updated by Tomasz Kaminski <[email protected]>: https://gcc.gnu.org/g:ce285dde2110f453fdbbd89fbb2f85a4d039705d commit r17-2787-gce285dde2110f453fdbbd89fbb2f85a4d039705d Author: Tomasz KamiÅski <[email protected]> Date: Tue Jul 28 16:43:49 2026 +0200 libstdc++: Resolve UNTIL save adjustment at tzdb loading time [PR116110] This patch moves the save calculation (ZoneInfo::calc_save) to database loading code (reload_tzdb) instead of applying it on demand when zone is queried (time_zone::_M_get_sys_info). This eliminates the performance impact on non-first calls (that return the cached result), caused by iterator adjustment checks. Local performance test indicate a 10% cost (30ns to 33ns on average) for cached queries with on-demand implementation (after r17-2466-g020e02fcf28), combined with huge swings on time on first calls. This patch leads 200ms increase (1.95s to 2.15s) on time of reload_tzdb, that happens only during initial load (and later explicit reload). As we need two bits of state (expanded or until_pending), I have decided to keep the four value m_state enum. PR libstdc++/116110 libstdc++-v3/ChangeLog: * src/c++20/tzdb.cc (time_zone::_M_get_sys_info): Remove ZoneInfo::calc_save invocation and related iterator adjustment. (chrono::reload_tzdb): Calculate save (invoke calc_save) for all infos on all zones. Reviewed-by: Jonathan Wakely <[email protected]> Signed-off-by: Tomasz KamiÅski <[email protected]>
