raygun.com
2. Monitor Xhr Call...
Excerpt
On the flipside, monitoring SPAs for performance is pretty challenging. Some of the biggest headaches are choosing the most helpful metrics, gaining visibility into app performance over time, and knowing what metrics you can get from the browser. The main benefit of using SPAs is that a page does not need to reload when the content on the page changes. However, this feature, and the fact the page does not reload, is also what makes it hard to monitor SPA performance. Plus, the HTML is rendered locally, running on JavaScript in the browser, introducing more unpredictability and potential slowdowns. … |Advantages|Disadvantages| |--|--| |- Faster user experience with dynamic UI updates|- Longer initial load time| |- Reduced server load and bandwidth usage|- Difficulty for search engines to crawl and index| |- Improved performance with lazy loading and caching|- Limited functionality with JavaScript disabled| |- Seamless navigation without full page reloads|- Increased complexity in development and maintenance| |- Efficiently build complex UI with frameworks| | … #### User drawbacks of SPAs The major disadvantage of SPAs is the initial load time, especially if the application is large or the internet connection on the user side is slow. Because all the necessary assets and code must be loaded upfront, that can introduce significant overhead. SPAs also come with a very heavy reliance on JavaScript in the browser. As most of the content loads dynamically via JavaScript, it may not work perfectly (or at all) on the user side if JavaScript is disabled on the browser. #### Developer drawbacks of SPAs It’s more difficult for search engines to crawl and index SPAs as most of the content is generated dynamically by JavaScript. This can result in poor SEO for your SPA, and no matter how great your app is, nobody will see it. Building and maintaining SPAs is also more complex than multi-page applications. Because of their structure and skew towards client-side processing, they can be tricky to maintain, debug, monitor and optimize. … #### Rendering performance issues SPAs often require the end-user to download a large amount of JavaScript, CSS, images, and other web assets during the initial page load. This leads to slow loading of SPAs, and if the network connection is slow, it worsens the situation. Besides which, most SPAs use bundlers like Webpack or Parcel to bundle JavaScript and other web assets together. This can also cause slow loading time if the bundle is too large. … #### Data fetching issues Inefficient data fetching and rendering processes can impact the performance of SPAs. If the application has issues like over-fetching or under-fetching, lack of data caching, insufficient data transformation, unnecessary rendering, inefficient event handling and listeners, this may result in sluggish rendering, slow data retrieval, and poor user experience.
Source URL
https://raygun.com/blog/spa-performance/Related Pain Points
Performance Optimization and Initial Load Times
8SPAs often ship large JavaScript bundles causing slow initial load times. 84% of users expect sub-3-second loads, and delays reduce conversions (1-second delay = 7% conversion drop, 3+ seconds = 40-53% bounce rate). Initial page loads can be 300+ KB for content that should be 4 KB.
Performance Issues: Unnecessary Re-renders and Bundle Size
7React applications suffer from unnecessary re-renders, large bundle sizes, slow initial page loads, memory leaks, and poor mobile performance. These issues are partly inherent to client-side SPAs lacking server-side rendering or static site generation.
Monitoring tools not designed for developer-centric performance workflows
6Current application monitoring tools lack developer-friendly workflows for performance issues comparable to error debugging. Developers want the same level of detail and actionability for performance problems as they get for error tracking, but this is not available.
SPAs have poor search engine crawlability and SEO
6Search engines struggle to crawl and index SPAs because most content is dynamically generated by JavaScript rather than present in the initial HTML. This results in poor SEO performance, making SPAs difficult to discover.
SPA development is more complex to maintain and debug
6Building and maintaining SPAs is significantly more complex than multi-page applications due to their client-side processing architecture. They are tricky to maintain, debug, monitor, and optimize, increasing overall development complexity.
SPAs don't work properly when JavaScript is disabled
4SPAs have very heavy reliance on JavaScript for rendering content dynamically. If JavaScript is disabled on the user's browser, the application may not work at all or have severely limited functionality.