Closed
Bug 773520
Opened 12 years ago
Closed 12 years ago
Add a cache for mapping stringbuffers to JS external strings
Categories
(Core :: DOM: Core & HTML, defect)
Tracking
()
RESOLVED
FIXED
mozilla18
People
(Reporter: bzbarsky, Assigned: bzbarsky)
References
(Blocks 1 open bug)
Details
Attachments
(4 files)
(deleted),
patch
|
Details | Diff | Splinter Review | |
(deleted),
text/plain
|
Details | |
(deleted),
text/plain
|
Details | |
(deleted),
patch
|
peterv
:
review+
bhackett1024
:
review+
|
Details | Diff | Splinter Review |
If we had such a beastie, we could handle repeated attempts to JS-wrap the same stringbuffer by just lookup and returning the JSExternalString.
The finalizer we use for JSExternalString could remove from the hashtable as needed.
Assignee | ||
Updated•12 years ago
|
Blocks: ParisBindings
Comment 1•12 years ago
|
||
This would be similar to JSStringCache used in JSDOMBinding.h
Which was added in https://bugs.webkit.org/show_bug.cgi?id=33768
Assignee | ||
Comment 2•12 years ago
|
||
Assignee | ||
Comment 3•12 years ago
|
||
I loaded gmail, zimbra, New York Times, a few other websites I can't recall, Google Reader.
There are about 65000 entries. Of those, about 500 are during browser startup.
Assignee | ||
Comment 4•12 years ago
|
||
Assuming I didn't screw anything up, this should measure hit and miss rates for a one-slot cache and a hashtable. And those are:
Slot hits: 12155
misses: 20369
Cache hits: 21845
misses: 10679
So even the one-slot cache ends up hitting more than 37% of the time.
I vote we just do that. ;)
Assignee | ||
Updated•12 years ago
|
Summary: Add a hashtable mapping PRUnichar* to JS external strings → Add a cache for mapping stringbuffers to JS external strings
Assignee | ||
Comment 5•12 years ago
|
||
Attachment #642183 -
Flags: review?(peterv)
Attachment #642183 -
Flags: review?(bhackett1024)
Assignee | ||
Updated•12 years ago
|
Assignee: nobody → bzbarsky
Whiteboard: [need review]
Comment 6•12 years ago
|
||
Comment on attachment 642183 [details] [diff] [review]
This shaves another 15ns off a typical getAttribute call. There's still more gunk in the string-wrapping code (e.g. several levels of function calls), unfortunately.
Review of attachment 642183 [details] [diff] [review]:
-----------------------------------------------------------------
Looks good to me, sorry for the delay.
Attachment #642183 -
Flags: review?(bhackett1024) → review+
Comment 7•12 years ago
|
||
Comment on attachment 642183 [details] [diff] [review]
This shaves another 15ns off a typical getAttribute call. There's still more gunk in the string-wrapping code (e.g. several levels of function calls), unfortunately.
Review of attachment 642183 [details] [diff] [review]:
-----------------------------------------------------------------
Don't forget to replace NULL with nullptr.
Attachment #642183 -
Flags: review?(peterv) → review+
Assignee | ||
Comment 8•12 years ago
|
||
Flags: in-testsuite-
Whiteboard: [need review]
Target Milestone: --- → mozilla18
Comment 9•12 years ago
|
||
Status: NEW → RESOLVED
Closed: 12 years ago
Resolution: --- → FIXED
Updated•6 years ago
|
Component: DOM → DOM: Core & HTML
You need to log in
before you can comment on or make changes to this bug.
Description
•