Closed
Bug 957593
Opened 12 years ago
Closed 12 years ago
txXSLTNumber::isAlphaNumeric should be using lookup tables
Categories
(Core :: XSLT, defect)
Core
XSLT
Tracking
()
RESOLVED
FIXED
mozilla29
People
(Reporter: froydnj, Assigned: froydnj)
Details
Attachments
(2 files, 1 obsolete file)
|
13.56 KB,
patch
|
peterv
:
review+
|
Details | Diff | Splinter Review |
|
21.89 KB,
patch
|
peterv
:
review+
|
Details | Diff | Splinter Review |
isAlphaNumeric takes up ~8KB on ARM, ~11KB on x86-64. Let's save a significant amount of space by using lookup tables instead.
| Assignee | ||
Updated•12 years ago
|
Assignee: nobody → nfroyd
| Assignee | ||
Comment 1•12 years ago
|
||
Matching a single character is the same as matching an inclusive range of
characters where the start and end are the same. This is mostly a
mechanical patch so that part 2 is less cluttered.
| Assignee | ||
Comment 2•12 years ago
|
||
This patch saves ~5KB on ARM, ~7KB on x86-64.
It does make the (common?) ASCII case slower, but we could re-insert
explicit checks for the ASCII range if desired. I don't know how many
people really care about XSLT performance in Firefox.
Attachment #8357173 -
Flags: review?(peterv)
| Assignee | ||
Comment 3•12 years ago
|
||
Comment on attachment 8357170 [details] [diff] [review]
part 1 - eliminate TX_MATCH_CHAR
comment 1 has details.
Attachment #8357170 -
Flags: review?(peterv)
Updated•12 years ago
|
Attachment #8357170 -
Flags: review?(peterv) → review+
Comment 4•12 years ago
|
||
Comment on attachment 8357173 [details] [diff] [review]
part 2 - implement txXSLTNumber::isAlphaNumeric with binary search for a codesize win
Review of attachment 8357173 [details] [diff] [review]:
-----------------------------------------------------------------
::: content/xslt/src/xslt/txXSLTNumber.cpp
@@ +731,5 @@
> + const CharRange* element = std::lower_bound(&alphanumericRanges[0], end, search);
> + if (element == end) {
> + return false;
> + }
> + return element->lower >= ch && ch <= element->upper;
This seems wrong, it ssems to me it should be:
return element->lower <= ch && ch <= element->upper;
Attachment #8357173 -
Flags: review?(peterv) → review-
| Assignee | ||
Comment 5•12 years ago
|
||
Ah, good catch, that was sloppy translation on my part.
Attachment #8357173 -
Attachment is obsolete: true
Attachment #8359398 -
Flags: review?(peterv)
Updated•12 years ago
|
Attachment #8359398 -
Flags: review?(peterv) → review+
| Assignee | ||
Comment 6•12 years ago
|
||
https://hg.mozilla.org/integration/mozilla-inbound/rev/1243b40c5da1
https://hg.mozilla.org/integration/mozilla-inbound/rev/f52e4fe3cf77
Flags: in-testsuite-
Comment 7•12 years ago
|
||
https://hg.mozilla.org/mozilla-central/rev/1243b40c5da1
https://hg.mozilla.org/mozilla-central/rev/f52e4fe3cf77
Status: NEW → RESOLVED
Closed: 12 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla29
You need to log in
before you can comment on or make changes to this bug.
Description
•