diff options
author | Mike FABIAN <mike.fabian@basyskom.de> | 2010-07-06 13:53:23 +0300 |
---|---|---|
committer | Mike FABIAN <mike.fabian@basyskom.de> | 2010-07-06 15:54:09 +0300 |
commit | 56b368da3c941305671cb6a1ef0607b2d3844f0b (patch) | |
tree | 7fc4afb78d14b0282f10469886188a959bcad5bf /tools | |
parent | 449fdf133eb1488e6201eede4076b1ba6bdc2d45 (diff) |
Fixes: NB#176803 - MLocale::formatDateTime allocates MLocale per call
RevBy: Armin Berres, John Tapsell
Details:
QString MLocale::formatDateTime(const MCalendar &mCalendar, const QString &formatString) const
did indeed allocate an extra instance of MLocale to be able to format
localized numbers according to the lc_time setting.
Instead of allocating an MLocale object for this, add another private
member to MLocale to cache another icu::NumberFormat and use this in
formatDateTime to format localized numbers.
Benchmark results using the benchmarks in the previous commit:
Old:
RESULT : Ut_MCalendar::benchmarkFormatDateTimePosixFormatString_U_QDateTime():
0.59 msecs per iteration (total: 76, iterations: 128)
RESULT : Ut_MCalendar::benchmarkFormatDateTimePosixFormatString_U_MCalendar():
0.57 msecs per iteration (total: 73, iterations: 128)
RESULT : Ut_MCalendar::benchmarkFormatDateTimePosixFormatString_V_MCalendar():
0.57 msecs per iteration (total: 73, iterations: 128)
RESULT : Ut_MCalendar::benchmarkFormatDateTimePosixFormatString_r_MCalendar():
1.3 msecs per iteration (total: 88, iterations: 64)
RESULT : Ut_MCalendar::benchmarkFormatDateTimePosixFormatString_R_MCalendar():
1.3 msecs per iteration (total: 84, iterations: 64)
RESULT : Ut_MCalendar::benchmarkFormatDateTimePosixFormatString_t_MCalendar():
0.53 msecs per iteration (total: 69, iterations: 128)
New:
RESULT : Ut_MCalendar::benchmarkFormatDateTimePosixFormatString_U_QDateTime():
0.28 msecs per iteration (total: 72, iterations: 256)
RESULT : Ut_MCalendar::benchmarkFormatDateTimePosixFormatString_U_MCalendar():
0.25 msecs per iteration (total: 66, iterations: 256)
RESULT : Ut_MCalendar::benchmarkFormatDateTimePosixFormatString_V_MCalendar():
0.24 msecs per iteration (total: 63, iterations: 256)
RESULT : Ut_MCalendar::benchmarkFormatDateTimePosixFormatString_r_MCalendar():
0.98 msecs per iteration (total: 63, iterations: 64)
RESULT : Ut_MCalendar::benchmarkFormatDateTimePosixFormatString_R_MCalendar():
1.0 msecs per iteration (total: 65, iterations: 64)
RESULT : Ut_MCalendar::benchmarkFormatDateTimePosixFormatString_t_MCalendar():
0.23 msecs per iteration (total: 60, iterations: 256)
Diffstat (limited to 'tools')
0 files changed, 0 insertions, 0 deletions