NEW 81865
Improve our style sharing algorithm parameters
https://bugs.webkit.org/show_bug.cgi?id=81865
Summary Improve our style sharing algorithm parameters
Julien Chaffraix
Reported 2012-03-21 19:49:00 PDT
Currently our style sharing algorithm uses those 2 values that I set a year ago: static const unsigned cStyleSearchThreshold = 10; static const unsigned cStyleSearchLevelThreshold = 10; Those were set up to improve style sharing and instrumenting our style sharing, I don't think they are an optimum of performance vs memory savings. My current discovery so far based on html5-full-render.html and moz, intl1, intl2 and alexa_us page cyclers: * Our current style sharing rate is 28.6% (that is out of 1000 calls to locateSharedStyle, 286 returns a match) * Most of the tree walking leads to bailing out without having a shared style (95% of the "budget" used by the algorithm (|count| and |visitedNode| in locateSharedStyle) fails |sharedNode| NULL-check) * Overall, when styles are shared, we don't walk the tree that much (on average, |count| is around 1 and |visitedCount| is around 1 too). What I am missing is the distribution of the parameters to know what would be an optimum.
Attachments
Patch for discussion about the trade-offs we are ready to make, not necessarily the best choice but a good example. (2.54 KB, patch)
2012-03-21 20:02 PDT, Julien Chaffraix
no flags
Julien Chaffraix
Comment 1 2012-03-21 20:02:43 PDT
Created attachment 133174 [details] Patch for discussion about the trade-offs we are ready to make, not necessarily the best choice but a good example.
Ahmad Saleem
Comment 2 2022-09-30 14:50:05 PDT
At least one of the threshold exist still even today: https://github.com/WebKit/WebKit/blob/62782a8855305e19a8039168935016bb1b7ecfcf/Source/WebCore/style/StyleSharingResolver.cpp#L52 Is there any needed to look into on how to evolve this for any future refactoring or this can be tagged as "RESOLVED WONTFIX"? Thanks1
Note You need to log in before you can comment on or make changes to this bug.