Avoid recomputing animation properties when creating finite CSS text-color transitions
Categories
(Core :: Layout, defect, P3)
Tracking
()
People
(Reporter: perf-ai-bot, Assigned: denispal)
References
(Blocks 1 open bug)
Details
(Whiteboard: [foofrix:e6b639c2-dd77-4e99-9d40-c3fe8cce45ac])
Attachments
(1 external file, 1 obsolete file)
Corrected (v2) CSS transition creation fast path, scoped to the color longhand.
Problem
Every newly created CSS color transition pays a redundant computed-value round trip on the content main thread inside Speedometer 3's measured windows. nsTransitionManager::DoCreateTransition already holds the transition's start and end values as computed AnimationValues, but it uncomputes them into keyframe declarations and KeyframeEffect::SetKeyframes -> UpdateProperties -> BuildProperties then clones the keyframes and calls Servo_GetComputedKeyframeValues + BuildSegmentsFromValueEntries to recompute exactly those AnimationValues and rebuild the single from/to segment, allocating and sorting along the way. In the TodoMVC-Vue baseline profile the transition-creation machinery is ~190 of ~7220 measured-window samples (~2.6% of measured main-thread time), of which the redundant keyframe recomputation portion (~67 samples: GetAnimationPropertiesFromKeyframes, Servo_GetComputedKeyframeValues, keyframe Clone, BuildSegmentsFromValueEntries) is pure overhead for color transitions; CompletingAllItems starts ~100 color transitions per iteration because todomvc-app-css puts "transition: color .4s" on every todo label, and the same CSS is shared by all SP3 TodoMVC subtests. For properties other than color the recomputation is NOT redundant (it re-applies style adjustments such as display blockification, as the starting-style-adjustment.html WPT demonstrates), so the fast path is restricted to the color longhand where skipping it is exactly equivalent.
Performance
- Benchmark: speedometer3-todomvc-vue
- Component: Layout
- Local Improvement: 1.6%
Validation
| Reporter | ||
Updated•1 month ago
|
| Reporter | ||
Comment 1•1 month ago
|
||
Please move this bug to the correct component.
Once the Phabricator patch is ready for review, please commandeer it.
| Reporter | ||
Comment 2•1 month ago
|
||
Corrected (v2) CSS transition creation fast path, scoped to the color longhand.
Updated•1 month ago
|
Updated•1 month ago
|
| Assignee | ||
Updated•1 month ago
|
| Assignee | ||
Updated•1 month ago
|
| Assignee | ||
Updated•1 month ago
|
| Assignee | ||
Comment 3•1 month ago
|
||
| Assignee | ||
Comment 4•1 month ago
|
||
Speedometer 3’s TodoMVC tests trigger many text-color transitions when items are marked complete. For transitions with finite computed color components, this patch builds the animation property directly, skipping the Stylo work that recomputes the endpoints from keyframes. Try results show median Speedometer 3 score improvements of approximately 0.2–0.8%. Before-and-after TodoMVC-Vue profiles show approximately 25% fewer inclusive samples in DoCreateTransition.
Comment 5•1 month ago
|
||
The severity field is not set for this bug.
:emilio, could you have a look please?
For more information, please visit BugBot documentation.
Updated•1 month ago
|
Description
•