Closed
Bug 558270
Opened 16 years ago
Closed 15 years ago
unroll Duff proper
Categories
(Core :: JavaScript Engine, defect)
Core
JavaScript Engine
Tracking
()
RESOLVED
FIXED
People
(Reporter: luke, Assigned: luke)
Details
(Whiteboard: fixed-in-tracemonkey)
Attachments
(2 files, 1 obsolete file)
|
3.78 KB,
patch
|
Waldo
:
review+
|
Details | Diff | Splinter Review |
|
1.02 KB,
application/javascript
|
Details |
It just occurred to me that the the loop in Duff could be unrolled further so that, once the loop gets revved up, it only does addition every X iterations, where X is the unroll factor (currently 8). (So, not really Duff's device, just classic loop unrolling.)
A quick micro-bench shows a 38% speedup when the text is long (150 chars), the pattern is short (2), and the match is at the end. To wit, compared to jsc (opt shell build from January I had lying around) we are: 1.58x faster without -j, 2.16x faster with -j, and 3.34x faster with the patch and -j.
| Assignee | ||
Comment 1•16 years ago
|
||
Measured with -j:
Trunk Patch
Match early: 31 28
Match at end, with false positives: 99 80
Match at end: 71 46
It looks like my 38% figure was conservative (measured without -j).
| Assignee | ||
Comment 2•16 years ago
|
||
Attachment #438046 -
Attachment is obsolete: true
Comment 3•16 years ago
|
||
awesome
| Assignee | ||
Comment 4•16 years ago
|
||
No observed speedup on SS/V8. But still, for patlen >= 2 (and out of the BMH range (<11 or >255)), this seems like a big win for long text strings.
| Assignee | ||
Updated•16 years ago
|
Attachment #438045 -
Flags: review?(jwalden+bmo)
Updated•16 years ago
|
Attachment #438045 -
Flags: review?(jwalden+bmo) → review+
| Assignee | ||
Comment 5•16 years ago
|
||
Whiteboard: fixed-in-tracemonkey
| Assignee | ||
Updated•15 years ago
|
Status: ASSIGNED → RESOLVED
Closed: 15 years ago
Resolution: --- → FIXED
Comment 6•15 years ago
|
||
(In reply to comment #3)
> awesome
I think you mean, "Ooh, yeah!"
But then again, "Duff man says a lot of things!"
You need to log in
before you can comment on or make changes to this bug.
Description
•