Dan Luu on Nostr: Naive question for front-end folks: why do React apps in the real world tend to be ...
Naive question for front-end folks: why do React apps in the real world tend to be slow?
I tried doing some React tutorial, and the result was quite fast (in terms of latency & CPU utilization) until the tutorial has you replace "manual" / "low-level" react calls with commonly used libraries, e.g., using TanStack Query instead of useEffect plus a manually instantiated cache.
Is the main issue that libraries tend to be big and slow or is there another major cause of React app slowness?
Published at
2024-05-01 22:58:34Event JSON
{
"id": "2f3207f090cad050a1cc29b012b2f9fc02fd294f44f7f3ec74fb86832a07837d",
"pubkey": "0ecb1c9b6fc91390ab51a5a39082f44c4abe0a19ad67c63b709d175ebf23e0f2",
"created_at": 1714604314,
"kind": 1,
"tags": [
[
"proxy",
"https://mastodon.social/users/danluu/statuses/112368308357914085",
"activitypub"
]
],
"content": "Naive question for front-end folks: why do React apps in the real world tend to be slow?\n\nI tried doing some React tutorial, and the result was quite fast (in terms of latency \u0026 CPU utilization) until the tutorial has you replace \"manual\" / \"low-level\" react calls with commonly used libraries, e.g., using TanStack Query instead of useEffect plus a manually instantiated cache.\n\nIs the main issue that libraries tend to be big and slow or is there another major cause of React app slowness?",
"sig": "49cf7353ed5ada702b62a8229530fbf1c549643246a6e3e5dda95dd9c48f669a3b8334f566b209e416fa840772735090e1bee3c1a071108bdc777dacbb327e69"
}