Closed
Bug 201670
Opened 22 years ago
Closed 22 years ago
nsCollation::UnicodeToChar should cache aCharset, not mEncoderCharsetAtom
Categories
(Core :: Internationalization, defect)
Tracking
()
RESOLVED
FIXED
People
(Reporter: neil, Assigned: smontagu)
References
Details
(Keywords: perf)
Attachments
(1 file, 3 obsolete files)
(deleted),
patch
|
smontagu
:
review+
alecf
:
superreview+
|
Details | Diff | Splinter Review |
Wondering why it takes Mail 3-4 seconds to sort 12500 strings, I ran jprof and found that more than half of this time is used within GetCharsetAtom! I converted it to using an instance reference to the charset alias service, and jprof now says GetCharsetAtom takes 2/3 of the time and the sort is down to 2-3s.
Reporter | ||
Comment 1•22 years ago
|
||
Reporter | ||
Comment 2•22 years ago
|
||
Actually I think there's further room for improvement creating collation keys.
Blocks: 63759
Reporter | ||
Comment 3•22 years ago
|
||
I just got a better idea.
Summary: nsCharsetConverterManager should cache charset alias service → nsCollation::UnicodeToChar should cache aCharset, not mEncoderCharsetAtom
Reporter | ||
Comment 4•22 years ago
|
||
Attachment #120207 -
Attachment is obsolete: true
Reporter | ||
Comment 5•22 years ago
|
||
Reporter | ||
Comment 6•22 years ago
|
||
Comment on attachment 120568 [details] [diff] [review] Proposed patch This patch makes sorting messages 200% faster on Linux and probably most other OSes e.g. Win9x but NOT WinNT which already uses fast native unicode sorting.
Attachment #120568 -
Flags: superreview?(sspitzer)
Attachment #120568 -
Flags: review?(yokoyama)
Assignee | ||
Comment 7•22 years ago
|
||
This looks good, but could we go further? Could GetDefaultCharsetForLocale return a charset atom instead of a nsString? (If it has to be a string I would prefer an nsCString, but that's another story.)
Comment 8•22 years ago
|
||
Comment on attachment 120569 [details]
diff -w so you can read it
hmm. I have to agree, why don't we just cache the atom?
Reporter | ||
Comment 9•22 years ago
|
||
OK but I didn't want to go mucking around with the interfaces without approval.
Comment 10•22 years ago
|
||
approval from whom? :) as long as the interface isn't marked FROZEN (and maybe UNDER_REVIEW) then the interface is just like any other code - you get the right module owner review and/or approval and so forth..
Reporter | ||
Comment 11•22 years ago
|
||
OK, so have I got this right? The only user of nsCollation is nsCollation<platform>. These never change mCharset after they create nsCollation. So, they can pass mCharset to a nsCollation method to create the converter. In fact, I pass the PRUnichar * to save some conversions. If you forget or fail to set the charset then it falls back on ISO-8859-1.
Reporter | ||
Updated•22 years ago
|
Attachment #120568 -
Attachment is obsolete: true
Attachment #120569 -
Attachment is obsolete: true
Reporter | ||
Comment 12•22 years ago
|
||
Comment on attachment 120821 [details] [diff] [review] New approach OS/2 never does unicode conversion so I just junked all the charset code.
Attachment #120821 -
Flags: superreview?(alecf)
Attachment #120821 -
Flags: review?(smontagu)
Reporter | ||
Comment 13•22 years ago
|
||
Oh, and should this get r+sr feel free to check it in before I can on Tuesday.
Comment 14•22 years ago
|
||
Comment on attachment 120821 [details] [diff] [review] New approach nice. this is a million times better. Sorry for the delay in reading it... sr=alecf smontagu, can you r= this in time for 1.4 beta?
Attachment #120821 -
Flags: superreview?(alecf) → superreview+
Assignee | ||
Comment 15•22 years ago
|
||
Comment on attachment 120821 [details] [diff] [review] New approach r=smontagu
Attachment #120821 -
Flags: review?(smontagu) → review+
Assignee | ||
Comment 16•22 years ago
|
||
cc-ing mkaply in case there are issues with comment 12.
Comment 17•22 years ago
|
||
Neil and I talked about this and we think we are OK.
Assignee | ||
Comment 18•22 years ago
|
||
Fix checked in.
Status: NEW → RESOLVED
Closed: 22 years ago
Resolution: --- → FIXED
Comment 19•22 years ago
|
||
good work, this may help bug 160140
Updated•22 years ago
|
Attachment #120568 -
Flags: superreview?(sspitzer)
Attachment #120568 -
Flags: review?(yokoyama)
You need to log in
before you can comment on or make changes to this bug.
Description
•