Skip to content

Destroy causes expensive forced Recalculate Layout event #373

Open
@fabianeichinger

Description

@fabianeichinger

I noticed in a project using this library, that calling destroy() on a KeenSlider instance very often forces a task-blocking Recalculate Layout event, causing jank with complicated layouts. When destroying more than one slider in the same microtask, this can happen for each one multiplying the performance hit.

Profiling points to applyAttributes(remove) calling dir(element) in a ternary operator as the cause. The result of dir doesn't matter in this case as remove is true when destroying, so it seems avoidable by flipping the &&.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions