Closed
Bug 856368
Opened 12 years ago
Closed 12 years ago
Some nsPresArena improvements
Categories
(Core :: Layout, defect)
Core
Layout
Tracking
()
RESOLVED
FIXED
mozilla23
People
(Reporter: MatsPalmgren_bugz, Assigned: MatsPalmgren_bugz)
Details
(Keywords: perf)
Attachments
(6 files, 1 obsolete file)
4.57 KB,
patch
|
roc
:
review+
|
Details | Diff | Splinter Review |
20.96 KB,
patch
|
Details | Diff | Splinter Review | |
13.96 KB,
patch
|
roc
:
review+
|
Details | Diff | Splinter Review |
2.80 KB,
patch
|
roc
:
review+
|
Details | Diff | Splinter Review |
4.17 KB,
patch
|
roc
:
review+
|
Details | Diff | Splinter Review |
3.34 KB,
patch
|
roc
:
review+
|
Details | Diff | Splinter Review |
1. remove DEBUG_TRACEMALLOC_PRESARENA -- it's not very useful now that we
have valgrind/ASan annotations and it blocks other improvements
2. get rid of the extra indirection through the mState pointer, we should
just store that data in the nsPresArena itself
I'm dividing this into several patches for easier review of each step.
Assignee | ||
Comment 1•12 years ago
|
||
Attachment #731569 -
Flags: review?(roc)
Assignee | ||
Comment 2•12 years ago
|
||
Attachment #731570 -
Flags: review?(roc)
Assignee | ||
Comment 3•12 years ago
|
||
This is probably easier to review without the white-space changes.
Attachment #731571 -
Flags: review?(roc)
Assignee | ||
Updated•12 years ago
|
Attachment #731570 -
Flags: review?(roc)
Assignee | ||
Comment 4•12 years ago
|
||
Attachment #731572 -
Flags: review?(roc)
Assignee | ||
Comment 5•12 years ago
|
||
Attachment #731573 -
Flags: review?(roc)
Assignee | ||
Comment 6•12 years ago
|
||
Attachment #731574 -
Flags: review?(roc)
Assignee | ||
Comment 7•12 years ago
|
||
Attachment #731575 -
Flags: review?(roc)
Assignee | ||
Comment 8•12 years ago
|
||
(In reply to Mats Palmgren [:mats] from comment #0)
> 1. remove DEBUG_TRACEMALLOC_PRESARENA -- it's not very useful now that we
> have valgrind/ASan annotations and it blocks other improvements
I've used it for other things. And it really should be trivial to readd support at the end of the patch series, no?
(In reply to Mats Palmgren [:mats] from comment #6)
> Created attachment 731574 [details] [diff] [review]
> Remove #include of nscore.h
NS_HIDDEN makes non-virtual functions substantially faster in the cases where it kicks in (since on some platforms non-virtual functions that are exposed across library boundaries are performance-wise like virtual functions). Is this really unused? (Did we solve that problem globally with libxul?)
Assignee | ||
Comment 10•12 years ago
|
||
(In reply to David Baron [:dbaron] (don't cc:, use needinfo? instead) from comment #9)
> I've used it for other things.
Could you describe what other things?
> And it really should be trivial to readd
> support at the end of the patch series, no?
Yes, but I have further improvements in mind and I think
DEBUG_TRACEMALLOC_PRESARENA would make those more complicated.
My idea is to make all pres arenas aligned on a page boundary so that
you can take any arena allocated object and find the arena header with
a bit mask on its address, then store mPresContext/Shell there for fast
access, replacing the slow indirection we do through
nsIFrame->mStyleContext->mRuleNode->mPresContext[->mPresShell]
(and, maybe get rid of mPresContext on the rule node?)
> NS_HIDDEN makes non-virtual functions substantially faster in the cases
> where it kicks in.
OK, I'll keep them.
Flags: needinfo?(dbaron)
Assignee | ||
Updated•12 years ago
|
Attachment #731574 -
Attachment is obsolete: true
Attachment #731574 -
Flags: review?(roc)
Assignee | ||
Comment 11•12 years ago
|
||
(In reply to David Baron [:dbaron] (don't cc:, use needinfo? instead) from comment #9)
> NS_HIDDEN makes non-virtual functions substantially faster in the cases
> where it kicks in
All these methods are now defined in the class though, eg:
void FreeByFrameID(nsQueryFrame::FrameIID aID, void* aPtr)
{
Free(aID, aPtr);
}
I'd be very surprised if the compiler didn't inline that at the call site.
I guess NS_HIDDEN could help a bit with link time/size though.
If NS_HIDDEN makes the above faster *to call* then we have a lot of room
to optimize our code ;-)
Assignee | ||
Comment 12•12 years ago
|
||
Waldo, is there a reason mfbt/Attributes.h doesn't have a MOZ_HIDDEN ?
Attachment #731569 -
Flags: review?(roc) → review+
Attachment #731571 -
Flags: review?(roc) → review+
Attachment #731572 -
Flags: review?(roc) → review+
Attachment #731573 -
Flags: review?(roc) → review+
Attachment #731575 -
Flags: review?(roc) → review+
(In reply to Mats Palmgren [:mats] from comment #10)
> (In reply to David Baron [:dbaron] (don't cc:, use needinfo? instead) from
> comment #9)
> > I've used it for other things.
>
> Could you describe what other things?
I don't remember, but I'm reasonably confident I have.
> > And it really should be trivial to readd
> > support at the end of the patch series, no?
>
> Yes, but I have further improvements in mind and I think
> DEBUG_TRACEMALLOC_PRESARENA would make those more complicated.
>
> My idea is to make all pres arenas aligned on a page boundary so that
> you can take any arena allocated object and find the arena header with
> a bit mask on its address, then store mPresContext/Shell there for fast
> access, replacing the slow indirection we do through
> nsIFrame->mStyleContext->mRuleNode->mPresContext[->mPresShell]
> (and, maybe get rid of mPresContext on the rule node?)
OK, that sounds reasonable. Though it still should be trivial to readd at the end (by just bloating allocations with the prescontext pointer at the beginning).
Flags: needinfo?(dbaron)
Comment 14•12 years ago
|
||
(In reply to Mats Palmgren [:mats] from comment #12)
> Waldo, is there a reason mfbt/Attributes.h doesn't have a MOZ_HIDDEN ?
No particular reason. (And needinfo? is probably desirable in addition to CCing me, just in case I miss the bugmail.)
Assignee | ||
Comment 15•12 years ago
|
||
https://hg.mozilla.org/integration/mozilla-inbound/rev/339911b031de
https://hg.mozilla.org/integration/mozilla-inbound/rev/c30972306259
https://hg.mozilla.org/integration/mozilla-inbound/rev/88f523148180
https://hg.mozilla.org/integration/mozilla-inbound/rev/852f34e11e00
https://hg.mozilla.org/integration/mozilla-inbound/rev/7da222e62d5f
Flags: in-testsuite-
Comment 16•12 years ago
|
||
https://hg.mozilla.org/mozilla-central/rev/339911b031de
https://hg.mozilla.org/mozilla-central/rev/c30972306259
https://hg.mozilla.org/mozilla-central/rev/88f523148180
https://hg.mozilla.org/mozilla-central/rev/852f34e11e00
https://hg.mozilla.org/mozilla-central/rev/7da222e62d5f
Status: NEW → RESOLVED
Closed: 12 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla23
You need to log in
before you can comment on or make changes to this bug.
Description
•