Closed Bug 160140 Opened 23 years ago Closed 23 years ago

sort in xul treecol does not use locale sensitive sorting

Categories

(Core :: XUL, defect)

x86
Windows XP
defect
Not set
normal

Tracking

()

RESOLVED FIXED

People

(Reporter: ftang, Assigned: janv)

References

Details

Attachments

(1 file, 1 obsolete file)

this is spin off from 159188. in 159188 the sort order in treecol does not sort according to the locale order. naoki, please work with xul tree owner to fix it and use the sort services
Status: NEW → ASSIGNED
mine
Assignee: nhotta → varga
Status: ASSIGNED → NEW
Attached patch proposes fix (obsolete) — Splinter Review
This was probably not correctly copied from the XUL sort service. I spent some time until I found out it's actually a copy/paste mistake. Now I know how it works at least :)
Attachment #115087 - Flags: superreview?(jaggernaut)
Attachment #115087 - Flags: review?(waterson)
sigh, this will have noticable performance impact
Attachment #115087 - Flags: superreview?(jaggernaut)
Attachment #115087 - Flags: review?(waterson)
Comment on attachment 115087 [details] [diff] [review] proposes fix I've changed my mind, CompareString is expensive, we need to cache sort keys somehow.
Attachment #115087 - Attachment is obsolete: true
I tried to sort a data source with more than 1000 rows (not so big). Sorting of this data source was noticeable slower, even on my 1.5 Ghz machine. CompareString has to call GetRawSortKeyLen and CreateRawSortKey every time. So we end up with many redundant calls to GetRawSortKeyLen and CreateRawSortKey for the same string. I think we can "pre-cache" these sort keys using an arena and then call CompareRawSortKey directly (as we do now). Chris Waterson says it's a good idea.
Depends on: 201670
Attached patch patchSplinter Review
Fix for bug 201670 helped sorting performance a lot (around 300% according to Neil) I think we should land this for correctness since XUL sort service use the same API. I'll also file a new bug about caching sort keys to improve performance even more.
Attachment #121268 - Flags: review?(neil)
Comment on attachment 121268 [details] [diff] [review] patch >+ nsDependentString(lstr), >+ nsDependentString(rstr), >+ &result); > } > else > result = ::Compare(nsDependentString(lstr), > nsDependentString(rstr), Worth sharing those nsDependentStrings?
Attachment #121268 - Flags: review?(neil) → review+
Attachment #121268 - Flags: superreview?(jaggernaut)
Simplified, the code is: if (foo) { use1(nsDependentString(foopy)); } else { use2(nsDependentString(foopy)); } When run through, only one nsDependentString will be created, so there's no sharing possible, really. The compiler should even be able to reorder the code so it'll only generate the constructor (call) asm once, no need for us to do that IMO.
Comment on attachment 121268 [details] [diff] [review] patch sr=jag (didn't I sr a patch for this a month ago?)
Attachment #121268 - Flags: superreview?(jaggernaut) → superreview+
Checked in. Bug 203007 filed for the perf issue.
Status: NEW → RESOLVED
Closed: 23 years ago
Resolution: --- → FIXED
Component: XP Toolkit/Widgets: Trees → XUL
QA Contact: shrir → xptoolkit.widgets
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: