[whatwg/dom] Proposal: add `computed` attribute for great performance! (Issue #1318)

### What problem are you trying to solve?

When we need to frequently read some values ​​from DOM Element, the browser will perform reflow, which is a very large performance consumption. For example, read scrollTop, getBoundingClientRect. I believe there are many scenarios that need to frequently read the changes of these values, but doing these now will affect performance.

Why not pre-store the value in Element when calculating the next frame inside the browser to avoid reflowing again when reading, so as to greatly improve performance?

If pre-storing the calculated value for each element will consume too many resources, then we can support a property to indicate that the specified element needs to pre-store the calculated value, which will greatly improve performance without wasting resources.

I temporarily think of using `computed`. If there is a better proposal, please discuss it.

### What solutions exist today?

_No response_

### How would you solve it?

_No response_

### Anything else?

_No response_

-- 
Reply to this email directly or view it on GitHub:
https://github.com/whatwg/dom/issues/1318
You are receiving this because you are subscribed to this thread.

Message ID: <whatwg/dom/issues/1318@github.com>

Received on Tuesday, 15 October 2024 02:52:41 UTC