Performance Patterns
summary
Benchmarks need specifics: run ~200 rounds, filter outliers, prefer the median over mean, and remember setTimeout(0) ≈ 15ms in IE can mask tiny differences. Use profilers (Firebug, Chrome Speed Tracer, DynaTrace Ajax Edition) and jsperf for cross‑browser tests — jsperf.com is recommended. Load scripts asynchronously (defer/async or dynamic tags), chunk HTML to flush early (Google Instant example), minimize requests (data URIs, CDN), batch DOM writes and cache locals to avoid repeated expensive DOM crossings.
AI-written summary · about
chapters (21)
- 0:00Intro
- 0:19About me
- 5:21Results
- 6:07Quarters
- 6:59Benchmarks
- 13:42JavaScript blocks
- 13:58JavaScript at the bottom
- 14:58defer and async timeline
- 15:37flush() early
- 16:09Progressive rendering
- 20:02Script injection patterns
- 21:02HTTP chunking: not only HTML
- 24:56Preload sans execute
- 26:07Speeding Up
- 26:41Local variables
- 27:30Localization
- 28:24Init-time branching
- 32:23Regex loops
- 32:57Cashing lengths in loops
- 34:39How bad is A compared to B?
- 36:29Proxy pattern








