Closed
Bug 1170069
Opened 11 years ago
Closed 11 years ago
Use PLDHashTable2 in FontNameCache
Categories
(Core :: XPCOM, defect)
Core
XPCOM
Tracking
()
RESOLVED
FIXED
mozilla41
| Tracking | Status | |
|---|---|---|
| firefox41 | --- | fixed |
People
(Reporter: n.nethercote, Assigned: n.nethercote)
Details
Attachments
(1 file)
|
2.77 KB,
patch
|
froydnj
:
review+
|
Details | Diff | Splinter Review |
I tried to introduce PLDHashTable2 into FontNameCache in another bug but it
caused a Fennec start-up regression. I've now managed to find a variation that
avoids the regression.
| Assignee | ||
Comment 1•11 years ago
|
||
Attachment #8613361 -
Flags: review?(nfroyd)
Comment 2•11 years ago
|
||
Yikes...
Comment 3•11 years ago
|
||
Comment on attachment 8613361 [details] [diff] [review]
Use PLDHashTable2 in FontNameCache
Review of attachment 8613361 [details] [diff] [review]:
-----------------------------------------------------------------
::: gfx/thebes/gfxFT2FontList.cpp
@@ +622,5 @@
> {
> + // HACK ALERT: it's weird to assign |mOps| after we passed a pointer to
> + // it to |mMap|'s constructor. A more normal approach here would be to
> + // have a static |sOps| member. Unfortunately, this mysteriously but
> + // consistently makes Fennec start-up slower, so we take this
This is...awful. But I am glad to see that it's so obvious in this patch what the key change was. ;)
The best alternative I have is to have:
char mMap[sizeof(PLDHashTable2)]; // with some alignment magic
and use placement new-initialization on that with a static sOps in the constructor. (Probably with a Map() getter to hide the necessary casting.) I can't decide whether that's worse or better.
I wish we knew *why* this was the case, though; I'd expect the lone reference to global data to be no worse than having to initialize mOps for every single cache...Do you have any explanation for why this variant might be faster? (Acquired, perhaps, through hours of yelling at the computer?)
Attachment #8613361 -
Flags: review?(nfroyd) → review+
| Assignee | ||
Comment 4•11 years ago
|
||
> The best alternative I have is to have:
>
> char mMap[sizeof(PLDHashTable2)]; // with some alignment magic
>
> and use placement new-initialization on that with a static sOps in the
> constructor. (Probably with a Map() getter to hide the necessary casting.)
> I can't decide whether that's worse or better.
Worse, IMO :) Plus I suspect the regression involves the static member somehow, which is why I went for a hack that avoided creating one.
> I wish we knew *why* this was the case, though; I'd expect the lone
> reference to global data to be no worse than having to initialize mOps for
> every single cache...Do you have any explanation for why this variant might
> be faster? (Acquired, perhaps, through hours of yelling at the computer?)
No explanation, other than mysterious Android start-up performance regressions that don't affect other platforms are common. I've had a couple, glandium has battled them, etc. :(
Comment 6•11 years ago
|
||
Status: ASSIGNED → RESOLVED
Closed: 11 years ago
status-firefox41:
--- → fixed
Resolution: --- → FIXED
Target Milestone: --- → mozilla41
You need to log in
before you can comment on or make changes to this bug.
Description
•