Post #1071878
2026-04-10 02:18 UTC
Plain language guide to JavaScript performance:
* Don't do a lot
* Don't do something multiple times that only needs doing once
* Don't save things you later won't need
* Aim for fast code, not neat or terse code
* NEW: Don't download it if you're not going to use it
* NEW: Don't do it with JS if CSS or the browser can do it instead
* NEW: Don't do in the browser what can be done on the server
Edit: thanks for the suggestions!
That's all I can think of.
Replies (4)
-
@bendelarre@mastodon.social 2026-04-10 06:52
@heydon one more for you: * Don't do things the browser does for you
-
@twifkak@mas.to 2026-04-10 16:13
@heydon * Don't download code you won't run.
-
@Tijn@dosgame.club 2026-04-11 12:14
@heydon Keep it small. Keep it simple. True for all code tbh 😅
-
@stefanfrede@mastodon.social 2026-04-11 12:35
@heydon In the spirit of the Greek goddess of victory: "Just don't!"