Closed
Bug 96529
Opened 23 years ago
Closed 23 years ago
delay loading of unicharutil in nsString case conversion code
Categories
(Core :: XPCOM, defect)
Core
XPCOM
Tracking
()
RESOLVED
FIXED
mozilla0.9.6
People
(Reporter: ftang, Assigned: ftang)
References
Details
(Keywords: perf)
Attachments
(1 file, 2 obsolete files)
(deleted),
patch
|
ftang
:
review+
brendan
:
superreview+
|
Details | Diff | Splinter Review |
this is a spin off from 75041
I find out one of the reason unicharutil get load into memory is nsString case
conversion. I have a fix for it and will include later for scc to review.
Assignee | ||
Comment 1•23 years ago
|
||
Assignee | ||
Comment 2•23 years ago
|
||
with this one and 96530, we can remove the loading of unicharutil.dll with
-chrome blank.xul.
Status: NEW → ASSIGNED
Assignee | ||
Updated•23 years ago
|
Target Milestone: --- → mozilla0.9.5
Assignee | ||
Comment 4•23 years ago
|
||
add jbetak to the cc list.
Comment 5•23 years ago
|
||
Comment 6•23 years ago
|
||
How about something like attachment 47922 [details] [diff] [review]? This basically does the same thing as
your patch, ftang, but avoids scanning the string first. It proceeds using the
ASCII to upper/lower conversion until it hits a non-ASCII character. At that
point, it faults in the unicode utilities and lets it process the remainder of
the string. (Check my math to make sure I got the length parameter right.)
Assignee | ||
Comment 7•23 years ago
|
||
while (cp <= end) {
....
+ result = PRInt32(aToUpper
+ ? gCaseConv->ToUpper(cp, cp, end - cp)
+ : gCaseConv->ToLower(cp, cp, end - cp));
while cp == end, it will go into the loop and end-cp will be equal to 0.
Is that right? should it be end - cp + 1 ?
Comment 9•23 years ago
|
||
ftang: you are right! But perhaps a cleaner fix might be to simply let |end|
point one past the end of the string, and change the loop termination condition
to ``cp strictly less-than end''. Let me attach a patch...
Comment 10•23 years ago
|
||
Assignee | ||
Comment 11•23 years ago
|
||
Comment on attachment 48230 [details] [diff] [review]
make |end| point one past end of the string, alter loop condition to strictly less-than
r=ftang
It looks better.
Attachment #48230 -
Flags: review+
Assignee | ||
Updated•23 years ago
|
Attachment #46902 -
Attachment is obsolete: true
Assignee | ||
Updated•23 years ago
|
Attachment #47922 -
Attachment is obsolete: true
Comment 13•23 years ago
|
||
Comment on attachment 48230 [details] [diff] [review]
make |end| point one past end of the string, alter loop condition to strictly less-than
/me grumbles about selective respect for the 80 column limit.
sr=brendan@mozilla.org
Attachment #48230 -
Flags: superreview+
Assignee | ||
Updated•23 years ago
|
Assignee | ||
Comment 14•23 years ago
|
||
fixed and check in
Status: ASSIGNED → RESOLVED
Closed: 23 years ago
Resolution: --- → FIXED
Updated•4 years ago
|
Component: String → XPCOM
You need to log in
before you can comment on or make changes to this bug.
Description
•