Replies: 6 comments 1 reply
-
Related – #26 |
Beta Was this translation helpful? Give feedback.
-
I'm not convinced yet whether this is an optimisation that's actually worth it or not. I'd need a way to test this somehow for myself for a large number of observed elements and measure CPU / memory usage maybe, to see if there's a difference between using one or many RO instances. |
Beta Was this translation helpful? Give feedback.
-
Or if there was a comprehensive test / article / benchmark that demonstrated that using a single RO instance is significantly better, then I would consider it. |
Beta Was this translation helpful? Give feedback.
-
I forgot about this one: Seems like there's something in there, but I'd still need a way to benchmark CPU + memory usage, so that I could compare a results of the current implementation to one that uses a single instance. |
Beta Was this translation helpful? Give feedback.
-
I'd really appreciate someone well-versed in benchmarking UI to help out. |
Beta Was this translation helpful? Give feedback.
-
The implementation of https://github.com/jaredLunde/react-hook/blob/1dd3940a70699836347325dac2cfe9998b81a5a4/packages/resize-observer/src/index.tsx might work as inspiration. |
Beta Was this translation helpful? Give feedback.
-
Seems like it's more performant and the recommended pattern:
WICG/resize-observer#59
Beta Was this translation helpful? Give feedback.
All reactions