-
Bug
-
Resolution: Unresolved
-
P3: Somewhat important
-
None
-
6.10.0 Beta2
-
None
-
f7b9c9f60 (dev), 7530a86df (dev), e18e50070 (6.10), 50b054eeb (6.10), 9b5c31fe6 (6.9)
In QLocale::uiLanguages() (which, at ~250LOCs, is way too long, btw), there are several problematic operations on QStringList uiLanguages. The most obvious is the manual re-implementation of QStringList::removeDuplicates() as a quadratic instead of linear algorithm. This is easily solved by using the Real Thing™.
But in the addIfEquivalent(), the {{insert()}}s are done in the middle, too, and it's not clear whether they're all done near the end, where it would just be "meh", but not actually cause a complexity problem. In the worst case, though, the list is built back to front, which would make the construction have quadratic complexity, too (unless prepend optimization kicks in for in-the-middle-but-near-the-front insertions, too; tbc).
Ideally, the list would be build with only appends, iow: insertions are done in order of precedence. I haven't done enough analysis to determine whether that's feasible.
For Gerrit Dashboard: QTBUG-138851 | ||||||
---|---|---|---|---|---|---|
# | Subject | Branch | Project | Status | CR | V |
665165,4 | QLocale: fix quadratic reimplementation of QStringList::removeDuplicates() | dev | qt/qtbase | Status: MERGED | +2 | 0 |
665173,2 | QTranslator: drag QLocale::uiLanguages() call out of critical section | dev | qt/qtbase | Status: MERGED | +2 | 0 |
665315,2 | QTranslator: drag QLocale::uiLanguages() call out of critical section | 6.10 | qt/qtbase | Status: MERGED | +2 | 0 |
665393,2 | QLocale: fix quadratic reimplementation of QStringList::removeDuplicates() | 6.10 | qt/qtbase | Status: MERGED | +2 | 0 |
665440,1 | QTranslator: drag QLocale::uiLanguages() call out of critical section | 6.9 | qt/qtbase | Status: ABANDONED | 0 | 0 |
665444,2 | QLocale: fix quadratic reimplementation of QStringList::removeDuplicates() | 6.9 | qt/qtbase | Status: MERGED | +2 | 0 |