Details
-
Bug
-
Resolution: Unresolved
-
P3: Somewhat important
-
None
-
6.7
-
None
-
Fedora 39, KDE Plasma
Description
When profiling Neochat I found that calling
new Date().toLocaleString(Qt.locale(), Locale.LongFormat)
repeatedly contributes a non-negligible amount of cycles to the runtime.
This is because for each invocation the timezone data is recreated, despite it always being the same. It might be worth caching the timezone name lookup somehow.
Attached is a Flamegraph for
for (int i=0; i<1000; i++) { QDateTime time = QDateTime::currentDateTime(); qWarning() << QLocale().toString(time, QLocale::LongFormat); }
Tested with current 6.7 branch
Attachments
Issue Links
- relates to
-
QTBUG-115158 Time zone names and abbreviations are not localised
- Closed
-
QTBUG-124465 QDate::fromString very slow in 6.7.0
- Closed