Files
browser/src/string.zig
Karl Seguin 122a4f1001 perf: improve ResizeObserver performance
https://github.com/lightpanda-io/browser/pull/3000 improved the correctness of
ResizeObserver. The main changes were (a) making sure an observe results in
an initial callback and (b) invoking the callback for cases that we can
identity (e.g. visibility change).

Like the other observers, we triggered a check on domChanged. But, unlike the
other observers, the check is relatively expensive, namely because it involves
style lookups.

This commit introduces a number of performance improvements to reduce the check
and dispatch frequency.

1 - Only trigger on an allow list of attribute changed (id, class, hidden, width
 ...)
2 - Pre-filter only on observed elements
3 - Leverage the visibility cache for more efficient delivery
2026-07-24 11:23:00 +08:00

25 KiB