-
Notifications
You must be signed in to change notification settings - Fork 6.6k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Reduce the cache pressure of the CSSProperty array.
CSSProperty was recently inadvertently increased from 16 to 24 bytes. Fix that, and also get rid of the kPropertyClasses[] array; it burns ~6 kB of cache that we'd really like to have for everything else, and is a meaningless indirection. Instead, put every single CSS(Unresolved)Property instance into a tightly packed array, through some union trickery, making it possible to just index directly into it. (The vtable pointer is still an indirection, but we can't do much about that unless we start making our own OOP system.) This isn't strictly by the book (the casting of an union instance to a common base class isn't blessed by the standard), but should be fine in practice as long as we don't introduce multiple inheritance or similar shenanigans. Since we've now got everything in the same table (instead of having some in a table and some in a switch/case), we can easily get rid of all the different special cases; we no longer need if tests for whether something is an alias, for kVariable, etc.. There are some issues with LTO inlining, necessitating a bit uglier .h file than we'd like; I've filed a separate bug for that. Style perftest (Zen 2, LTO but no PGO): Initial style (µs) Before After Perf 95% CI (BCa) =================== ========= ========= ======= ================= ECommerce 9482 9359 +1.3% [ +0.9%, +1.7%] Encyclopedia 81544 81376 +0.2% [ -0.1%, +0.5%] Extension 130051 129406 +0.5% [ +0.2%, +0.8%] News 38561 38224 +0.9% [ +0.6%, +1.3%] Search 11209 11116 +0.8% [ +0.6%, +1.1%] Social1 23244 23177 +0.3% [ -0.3%, +0.5%] Social2 16139 15957 +1.1% [ +0.9%, +1.3%] Sports 42543 42553 -0.0% [ -0.2%, +0.2%] Video 32494 32414 +0.2% [ +0.0%, +0.5%] Geometric mean +0.6% [ +0.4%, +0.8%] Parse (µs) Before After Perf 95% CI (BCa) =================== ========= ========= ======= ================= ECommerce 1357 1346 +0.8% [ +0.1%, +1.1%] Encyclopedia 7649 7591 +0.8% [ +0.5%, +1.0%] Extension 1342 1294 +3.8% [ +3.2%, +5.1%] News 8024 7990 +0.4% [ +0.2%, +0.6%] Search 5132 5100 +0.6% [ +0.3%, +0.9%] Social1 14744 14583 +1.1% [ +0.8%, +1.4%] Social2 626 622 +0.7% [ -0.2%, +1.4%] Sports 56554 56087 +0.8% [ +0.6%, +1.1%] Video 33306 32879 +1.3% [ +1.1%, +1.5%] Geometric mean +1.1% [ +1.0%, +1.3%] Recalc style (µs) Before After Perf 95% CI (BCa) =================== ========= ========= ======= ================= ECommerce 10989 10838 +1.4% [ +1.0%, +1.9%] Encyclopedia 63024 62911 +0.2% [ -0.1%, +0.6%] Extension 118891 118495 +0.3% [ +0.1%, +0.6%] News 28392 28150 +0.9% [ +0.5%, +1.7%] Search 5916 5883 +0.6% [ +0.2%, +0.9%] Social1 16444 16378 +0.4% [ -0.3%, +0.8%] Social2 12838 12764 +0.6% [ +0.4%, +0.8%] Sports 21686 21723 -0.2% [ -0.6%, +0.1%] Video 21109 21078 +0.1% [ -0.1%, +0.7%] Geometric mean +0.5% [ +0.3%, +0.7%] MotionMark (win-10-perf, 95% CI): motionmark_ramp_canvas_arcs [ -0.3%, +0.2%] motionmark_ramp_canvas_lines [ +2.6%, +3.5%] motionmark_ramp_design [ -0.3%, +1.3%] motionmark_ramp_images [ -0.8%, +0.3%] motionmark_ramp_leaves [ +0.1%, +0.9%] motionmark_ramp_multiply [ +1.4%, +2.3%] motionmark_ramp_paths [ -3.8%, +0.9%] motionmark_ramp_suits [ +0.1%, +1.0%] MotionMark (mac-m1_mini_2020-perf, 95% CI): motionmark_ramp_canvas_arcs [ +0.3%, +0.7%] motionmark_ramp_canvas_lines [ -0.1%, +0.1%] motionmark_ramp_design [ -7.2%, +0.2%] motionmark_ramp_images [ -0.7%, +2.0%] motionmark_ramp_leaves [ +0.7%, +1.2%] motionmark_ramp_multiply [ -0.6%, +1.9%] motionmark_ramp_paths [ -0.2%, +0.6%] motionmark_ramp_suits [ -1.0%, -0.6%] Change-Id: I6150ad6398eb06d0a50f882a28f49a351ef1f940 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4573698 Reviewed-by: Anders Hartvoll Ruud <andruud@chromium.org> Commit-Queue: Steinar H Gunderson <sesse@chromium.org> Cr-Commit-Position: refs/heads/main@{#1151875}
- Loading branch information
Steinar H. Gunderson
authored and
Chromium LUCI CQ
committed
Jun 1, 2023
1 parent
9110947
commit fe9349c
Showing
10 changed files
with
96 additions
and
101 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters