Menu

Why your React page feels slow when the API is fast
📰

Why your React page feels slow when the API is fast

DEV Community: react·Nilu Mukherjee·6 days ago
#ouYNtyq8
#devtoreact#devto#dev#first#worklist
Long article (280 words) — no AI summary yet.
Reading 0:00
15s threshold

The API logs for an operations dashboard show 120 ms of server work. On the screen, the first useful row takes nearly two seconds to appear. A lot can happen in the browser before that row shows up. It might be waiting on requests, parsing JavaScript, or rendering data it already has.

I'd record one interaction, from clicking "Open dashboard" to seeing the first useful row. Use a production build. Run it once with a cold cache and again with a warm cache, and keep those results separate. The first run is closer to what a new user sees.

Check when each request starts

Suppose the trace shows the bundle loading and parsing before the app fetches the user. Then it fetches preferences, then the worklist. If the preferences only determine which columns to show, the worklist request can start once the app knows the session. Both requests can run at the same time.

If the worklist has already arrived, I'd open the React Profiler. The table might be rendering rows below the fold.…

Continue reading — create a free account

Join HashtagPLUS to read full articles, follow hashtags, vote, and join the conversation.