Bug 97627 - Optimize stylesheet insertions
Summary: Optimize stylesheet insertions
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: CSS (show other bugs)
Version: 528+ (Nightly build)
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Nobody
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2012-09-25 21:15 PDT by Antti Koivisto
Modified: 2012-09-26 20:47 PDT (History)
7 users (show)

See Also:


Attachments
patch with performance test (10.98 KB, patch)
2012-09-25 21:31 PDT, Antti Koivisto
kling: review+
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Antti Koivisto 2012-09-25 21:15:20 PDT
We currently do scope analysis for stylesheets that are added to the end of the active stylesheet list to avoid unnecessary style recalcs and StyleResolver rebuilding. However it is somewhat common to insert <style> elements dynamically to positions other than last. In this case we currently simply force full style recalc. We should do scope analysis and partial style recalcs also in these cases.
Comment 1 Antti Koivisto 2012-09-25 21:31:04 PDT
Created attachment 165724 [details]
patch with performance test
Comment 2 Andreas Kling 2012-09-26 05:42:25 PDT
Comment on attachment 165724 [details]
patch with performance test

View in context: https://bugs.webkit.org/attachment.cgi?id=165724&action=review

Neat! r=me

> Source/WebCore/ChangeLog:12
> +        PerformanceTests/CSS/StyleSheetInsert.html microbenchmark shows ~20x progression from the patch.

Glorious exposition, comrade!
Comment 3 Radar WebKit Bug Importer 2012-09-26 07:30:26 PDT
<rdar://problem/12376415>
Comment 4 Antti Koivisto 2012-09-26 07:55:28 PDT
http://trac.webkit.org/changeset/129644
Comment 5 Ryosuke Niwa 2012-09-26 13:55:43 PDT
Is it really worth running this test on every check in? FWIW, we already have a bot cycle time of one hour. Also, it seems like we could have used PerfTestRunner.runPerSecond here.
Comment 6 Antti Koivisto 2012-09-26 20:16:37 PDT
(In reply to comment #5)
> Is it really worth running this test on every check in? FWIW, we already have a bot cycle time of one hour. Also, it seems like we could have used PerfTestRunner.runPerSecond here.

We run our correctness regression tests on every check-in. Why wouldn't we run performance regressions tests like that too?

It is a pretty fast test and could be made faster too. I didn't know about PerfTestRunner.runPerSecond.
Comment 7 Ryosuke Niwa 2012-09-26 20:47:34 PDT
(In reply to comment #6)
> We run our correctness regression tests on every check-in. Why wouldn't we run performance regressions tests like that too?
> 
> It is a pretty fast test and could be made faster too. I didn't know about PerfTestRunner.runPerSecond.

The problem is that performance tests are much, much slower, and we can't parallelize them. Our current bot cycle is 50-60 minutes after disabling one test that was running out of memory on Chromium. And every new test will increase the run time by anywhere from 5 seconds to 5 minutes...