Destroy causes expensive forced Recalculate Layout event
fabianeichinger opened this issue · comments
Fabian Eichinger commented
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 &&
.