Add `contain` props here and there to improve perf
kurtextrem opened this issue · comments
contain: content
should work on every single tweet element .js-stream-item stream-item stream-item
(although if there's a video and you want to fullscreen it, we have to replace content
with layout style
.
I can take a look at PR'ing this if you don't have time.
Yeah, good idea. PR welcome :) Make sure to include proof of the performance improvement (Screenshot from Dev Tools is good).
Before: http://prntscr.com/ii7c2t
After: http://prntscr.com/ii7c7u
Difference I can see is 20ms less hit tests (test range 1,9s). Observed difference I can't really get into a gif/video: Sometimes when hovering over a tweet, the whole page flashes when having paint flashing enabled. contain
eliminates this.