Skip to content

Proposal: add computed attribute for great performance! #1318

Open
@anuoua

Description

@anuoua

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.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    addition/proposalNew features or enhancementsneeds implementer interestMoving the issue forward requires implementers to express interest

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions