Benchmarking slow LCP and TTI

I'm looking for advice on this, because I really don't have a mentor to turn to and I'm feeling pretty lost overall. I've detailed before that I'm refactoring a SPA made with CRA that is meant to replace an AngularJS app that was mounted inside a JSP and served as our previous "version" of this page. I've improved performance quite a bit compared to where it was, but I'm still seeing a rather large gap, and I'm trying to audit A) How much can I reasonably improve performance, and B) Where should I look for benefits at this point? For a bit more context - because the old application is in a JSP, it gets served HTML from our server which contains a pre-computed JSON string that is parsed and added to the page's service. The new version lives in an S3 bucket and sends multiple requests out for data upon page load. I originally thought this was the primary source of difference remaining between the two applications, because naturally sending to a remote server for data will be slower than parsing JSON that is passed alongside HTML. However, I experimented with removing those calls and simply parsing out a hard-coded JSON string with data, and I'm still reading a significant difference in mobile score (around 56 for the new vs 80-85 for the old page). When I profile the page (CPU 4x throttled, network fast 3G) I'm noticing a significant difference in the number of long tasks that appear to be falling under the umbrella of React-DOM vs the number that happen on the old AngularJS environment. I've attached screenshots of the trace, in case anything seems fishy. I genuinely don't really know how to interpret these results - does React-DOM often struggle when network/processing speeds are throttled, more so than this other app would? Any guidance would be invaluable to me. I'm feeling at a loss, and I don't know anyone that could help me with this, personally or professionally. I hope this question is acceptable, I'm sorry that it's abstract.
13 Replies
Unknown User
Unknown User2y ago
Message Not Public
Sign In & Join Server To View
Roren
Roren2y ago
Thank you very much for the response and the resources! I understand what you're saying, and I've been doing my best to continually audit the changes I make as I go to ensure they are having the effect I intend. When I started with this employer the app scored a 7 on mobile, and at this point I've got it up around 60, so we're headed in the right direction. The frustrating thing to me is just understanding the limits so I can properly convey them to my employer. Not having access to a back end for the app will I'm sure be a limitation that I will butt up against, it's just tough to tell when that will be. I went ahead and replaced React with Preact, as there's a pretty substantial difference in bundle size that seems to be contributing further to the FCP diff. I've gone through our bundle before to make sure we weren't including anything unnecessary, but I'm starting to think I'll need to be more discerning about what is and is not necessary.
Unknown User
Unknown User2y ago
Message Not Public
Sign In & Join Server To View
Roren
Roren2y ago
web.dev has been super vital to me understanding how the metrics work better. I've been using lighthouse CLI through node to get a median score across multiple page loads, but I might check that package out and see how convenient it is.
Unknown User
Unknown User2y ago
Message Not Public
Sign In & Join Server To View
Roren
Roren2y ago
Honestly I feel like I still don't quite "get" Speed Index, but I think I just need to read more. As an experiment I replaced basically every bit of logic/component in the App with just loading one 360x360 image, and was still observing slower FCP/LCP times than the entire Angular page. That's what made me decide I need to address the resources we're loading in.
Unknown User
Unknown User2y ago
Message Not Public
Sign In & Join Server To View
Roren
Roren2y ago
I'll definitely take a look! Generally the user we're targeting is a first time visitor to the site, so I don't know how effectively a cache could help us, but I'll absolutely check it out for my own information.
Unknown User
Unknown User2y ago
Message Not Public
Sign In & Join Server To View
Roren
Roren2y ago
I really do appreciate you responding, though. I like my coworkers, but as I mentioned I don't really have anyone on my team that's able to give me advice on stuff like this. Either they're more junior than I am, or they're more experienced but don't seem to be very keyed into the tech we're using. Which is totally understandable - I don't want anyone else to give me a solution, it just ends up feeling hopeless when it's just me banging my head against the wall.
Unknown User
Unknown User2y ago
Message Not Public
Sign In & Join Server To View
Roren
Roren2y ago
Oh, that's interesting
Unknown User
Unknown User2y ago
Message Not Public
Sign In & Join Server To View
Want results from more Discord servers?
Add your server