Just wrap it in a container with fixed height and "overflow: hidden". Now the layout engine knows that it doesn't need to recalculate positions of elements outside that wrapper, and it's much faster. By the way, the same trick was speeding up large rendering back in the day. As long as you know the size of your rows or columns ahead of time, which kinda defeats the purpose of .
Is there a good way to learn techniques like this from first principles other than trying to become an employed frontend dev?
If you have any experience programming 2D graphics with SDL this will help you to understand what is happening as well.
There is an old school talk by Nikolas Zakas on JavaScript Performance from 2009 which while some of it is out of date now due to improvements in Browser engines, the fundamental ideas are still the same.
https://www.youtube.com/watch?v=mHtdZgou0qU
If you skip to the 35 minute mark he speaks about reflow specifically. Generally I still use many of these techniques when writing vanilla JS (which is unfortunately rare these days). There are other talks where he talks about many other performance specific topics.
Obviously none of this is as good as real world experience of dealing with a thorny issue.