Closed Bug 1367209 Opened 7 years ago Closed 7 years ago

nsCounterManager::DestroyNodesFor does an unconditional hashtable iteration on every frame destruction

Categories

(Core :: Layout, enhancement)

53 Branch
enhancement
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla55
Performance Impact high
Tracking Status
firefox55 --- fixed

People

(Reporter: bzbarsky, Assigned: MatsPalmgren_bugz)

References

Details

(Keywords: perf)

Attachments

(5 files)

It's called from nsCSSFrameConstructor::NotifyDestroyingFrame.

We should consider having a flag on the frame that says that it _might_ be found in the counter manager.
Note that the call to nsGenConList::DestroyNodesFor in nsCSSFrameConstructor::NotifyDestroyingFrame is already guarded on a flag.
Whiteboard: [qf]
Whiteboard: [qf] → [qf:p1]
Assignee: nobody → mats
This file is a mess of different indentation and coding styles, 
let's just fix that once and for all.
Attachment #8874196 - Flags: review?(jfkthame)
Attachment #8874198 - Flags: review?(jfkthame)
This uses up the last remaining global frame bit, but I have patches
to convert some private bits to global to compensate for this.
Attachment #8874199 - Flags: review?(jfkthame)
(In reply to Mats Palmgren (:mats) from comment #5)
> This uses up the last remaining global frame bit, but I have patches
> to convert some private bits to global to compensate for this.

I'm guessing you probably meant to say "convert some global bits to private" here.
Attachment #8874196 - Flags: review?(jfkthame) → review+
Attachment #8874198 - Flags: review?(jfkthame) → review+
Attachment #8874199 - Flags: review?(jfkthame) → review+
Attachment #8874200 - Flags: review?(jfkthame) → review+
> I'm guessing you probably meant to say "convert some global bits to private" here.

No, I intend to move some of the private bits for "Block" and "Text" groups (which
are currently full) to bool:1 on their respective classes instead.  This makes two
bits in the private range unused, so they can be reclaimed as global bits instead.
I intend to convert more eventually, because I think it's a more efficient use of
the frame bits; currently there are many frame types that use none or only a few
of the reserved private bits.  I'll post the patches later...
Ah, I see. Yes, that makes sense.
Pushed by mpalmgren@mozilla.com:
https://hg.mozilla.org/integration/mozilla-inbound/rev/1005b7702f1e
part 1 - Fix some indentation and code style issues.  r=jfkthame
https://hg.mozilla.org/integration/mozilla-inbound/rev/fbfa99d9a737
part 2 - Remove a useless constructor.  r=jfkthame
https://hg.mozilla.org/integration/mozilla-inbound/rev/1b9d1468f7b4
part 3 - Add a generic frame state bit, NS_FRAME_HAS_CSS_COUNTERS, to indicate that a frame maybe has some counter styles and thus be known by nsCounterManager.  r=jfkthame
https://hg.mozilla.org/integration/mozilla-inbound/rev/22108a33acd5
part 4 - Use LookupForAdd to avoid an additional hashtable lookup when inserting a new entry.  r=jfkthame
Flags: in-testsuite-
Keywords: perf
OS: Unspecified → All
Hardware: Unspecified → All
Note that frames have free bool:1 bits as well.  See mMayHaveRoundedCorners and the following comment about there being space for 15 more bool:1 there.
Performance Impact: --- → P1
Whiteboard: [qf:p1]
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: