ecoacoustics / web-components

https://oe-web-components.netlify.app/
MIT License
1 stars 0 forks source link

Optimize render invalidation with efficient diff #149

Closed hudson-newey closed 4 weeks ago

hudson-newey commented 1 month ago

With our current implementation, our render invalidation (createSpectrogramElements) causes all the grid tiles to be destroyed and re-created.

At the moment, the only change that causes a render invalidation is the change in the grid size (e.g., through attribute changes, or initialization of the grid size).

Because grid sizes are now user-configurable with #148, render invalidation can be a lot of work for very large grid sizes.

To fix this, we should implement a diff algorithm that:

Notes for implementor: We might be able to use Lits repeat directive with a subject key, so that if the subject is the same, it doesn't mutate the tile