DescriptionDo not cache the result of RenderStyle::computedLineHeight()
We currently use 26-bits in RenderBlock to cache the result of
RenderStyle::computedLineHeight(). However when you look at the
computations behind that function the main components are already cached
so at most we are saving a handful of computations per call.
In https://codereview.chromium.org/256593009/ we added a test that calls
RenderBlock::lineHeight() ~425,000 times on each run. This CL results in
no measurable degradation in performance against that test.
So since we cannot get a measurable improvement in performance as a result
of the caching when testing locally, remove it and free up space for more useful
bits in RenderBlock. We will let it cycle through the perf bots for a while
before allowing people to start using the spare bits though.
The cached result originally sat in RenderText and was inherited from the
fork from KHTML. http://trac.webkit.org/changeset/6010 moved it to RenderBlock
on the basis that "calls to fontMetrics().lineSpacing() are expensive." This
is no longer the case as far as I can tell, since both lineSpacing() and
fontMetrics() are now cached themselves.
Committed: https://src.chromium.org/viewvc/blink?view=rev&revision=176233
Patch Set 1 #Patch Set 2 : Updated #Patch Set 3 : Updated #
Messages
Total messages: 6 (0 generated)
|