Consider using eslint to report synchronous layout flushes

NEW
Unassigned

Status

Testing
Lint
P4
normal
6 months ago
a month ago

People

(Reporter: florian, Unassigned)

Tracking

Version 3
Points:
---

Firefox Tracking Flags

(Not tracked)

Details

(Whiteboard: [reserve-photon-performance])

(Reporter)

Description

6 months ago
Calls to getComputedStyle or getBoundingRect dramatically affect performance as they force a synchronous layout flush.

I wonder if we should make eslint reject new calls to these methods, unless a specific annotation has been placed on the line.

Comment 1

6 months ago
Tests that count layout flushes during performance-critical operations seem like a better idea to me.

It often comes down to being smarter about when to flush layout and cache the results rather than completely eliminating the call. There are perfectly valid reasons for using getComputedStyle and friends, and imho people shouldn't have to learn some meta language to annotate their valid code. (We have started this anti-pattern with global-scope imports, but last I heard this was going to be temporary.)

Updated

6 months ago
No longer blocks: 1348289

Updated

6 months ago
Priority: -- → P2
Whiteboard: [photon-performance]

Updated

5 months ago
Priority: P2 → P3
Whiteboard: [photon-performance] → [reserve-photon-performance]

Updated

a month ago
Priority: P3 → P4
You need to log in before you can comment on or make changes to this bug.