Closed
Bug 84194
Opened 24 years ago
Closed 24 years ago
Patch that makes color parsing faster
Categories
(Core :: DOM: Core & HTML, defect)
Core
DOM: Core & HTML
Tracking
()
RESOLVED
FIXED
mozilla0.9.3
People
(Reporter: bratell, Assigned: bratell)
References
()
Details
(Keywords: perf, Whiteboard: [fix in hand])
Attachments
(4 files)
2.62 KB,
patch
|
Details | Diff | Splinter Review | |
1.75 KB,
patch
|
Details | Diff | Splinter Review | |
2.87 KB,
patch
|
Details | Diff | Splinter Review | |
2.92 KB,
patch
|
Details | Diff | Splinter Review |
The attached patch makes color parsing twice as fast. It doesn't matter on pages
beside the one in the URL which has 10000 colors specified, but anyway, it makes
that page load about 1% faster.
Assignee | ||
Comment 1•24 years ago
|
||
Assignee | ||
Updated•24 years ago
|
Comment 2•24 years ago
|
||
Thanks for the patch, I'll let Harish deal with this one.
One comment about the patch tho:
+ if (aString.Length() == 0) {
+ return PR_FALSE;
+ }
should use if (aString.IsEmpty()).
I'm glad to sr= this once Harish has a look at this (and once I actually *read*
the patch).
Assignee: jst → harishd
Comment 3•24 years ago
|
||
Harish, can you take a look at this patch so we can get it in? No sense in
letting it go to waste. Thanks.
Nit pick: nscolor declaration, i.e. nscolor color=0, could be delayed further.
And with suggested change from Johnny r=harishd.
Assignee | ||
Comment 5•24 years ago
|
||
I've done the two changes mentioned, but looking at this again, I see an even
greater optimization. No color name can start at '#', right? So we should look
at the first char, and if it's '#' do the numerical conversion.
I will attach a patch that does that in a little time.
Assignee | ||
Comment 6•24 years ago
|
||
Assignee | ||
Comment 7•24 years ago
|
||
Assignee | ||
Comment 8•24 years ago
|
||
This was better. Quantify numbers for 10000 calls:
In the code today 72.1 ms (1.73% of the total time)
The last patch 16.3 ms (0.43%)
(The percentages are approximate since I played with other stuff affecting the
total time for the page).
harishd, can you take a new look?
jst, I think this is mature enough for a real sr?
Comment 10•24 years ago
|
||
Looks good to me, sr=jst
Comment 11•24 years ago
|
||
Worth getting into .9.2/limbo?
Comment 12•24 years ago
|
||
Blake: I would say so.
Comment 13•24 years ago
|
||
Blake: I would say so.
Assignee | ||
Comment 14•24 years ago
|
||
I finally noticed that " " (SPACE) is missing from the set of whitespace chars.
That's fixed in my tree now.
Assignee | ||
Comment 15•24 years ago
|
||
Assignee | ||
Comment 16•24 years ago
|
||
harsihd, jst, here is a new patch that also strips SPACE. Can I have a new r/sr?
Comment 17•24 years ago
|
||
sr=jst
Comment 18•24 years ago
|
||
r=harishd.
Daniel: since you did all the work...reassigning bug to u :-)
Assignee: harishd → bratell
Status: ASSIGNED → NEW
Assignee | ||
Comment 19•24 years ago
|
||
Fix checked in
Assignee | ||
Comment 20•24 years ago
|
||
...and the bug is therefore FIXED.
Status: NEW → RESOLVED
Closed: 24 years ago
Resolution: --- → FIXED
Updated•24 years ago
|
QA Contact: lchiang → stummala
Updated•15 years ago
|
Component: DOM: Abstract Schemas → DOM: Core & HTML
QA Contact: stummala → general
You need to log in
before you can comment on or make changes to this bug.
Description
•