Optimizing FCP/LCP by caching raw-view module lookups

Unfortunately I haven’t been able to replicate this large speed increase. On Firefox and Chrome (macOS) I’m not seeing any measurable improvement. Chrome spends around 23ms in renderTopicListItem. Firefox 30ms. On an older android device (Pixel 3), I’m seeing around 108ms. The numbers don’t seem to change before/after the change.

By the way, I measured these numbers by using the performance API. I added performance.mark("rtli-start") at the start of renderTopicListItem, and then performance.measure("rtli", "rtli-start") at the end.

Then I reload the browser with dev tools closed and browser plugins disabled (dev tools and browser plugins can significantly affect rendering performance). Then after loading is complete, open dev tools and run this to sum up the measurements:

performance.getEntriesByName("rtli").reduce((v, m) => v + m.duration, 0);

We’ll definitely get this change merged - it’s clearly a better implementation. But I’m not sure whether it will give us a visible difference in render performance :thinking:

7 Likes