Skip to main content

6 docs tagged with "performance"

View all tags

Complexity — sizing speed and memory with big-O

This chapter explains big-O by starting from the idea of dropping constant factors and lower-order terms. It covers the feel of common orders, the difference between time and space complexity, how to count orders from loops and recursion, and when to use worst, average, and best cases.

Core Web Vitals — narrowing causes from LCP / INP / CLS

This chapter covers the definitions and thresholds of the three Core Web Vitals (LCP, INP, CLS), and the procedure for narrowing down the cause from combinations of the readings. It explains why slow server responses are not the main cause of poor INP and how CLS worsens with unsized late-arriving content.

Event loop — one thread juggling wait time

This chapter explains how JavaScript juggles both communication and timers on a single thread, from the execution order of tasks and microtasks. It covers when the continuation after await runs, why setTimeout(fn, 0) isn't "immediately", how a long task blocks painting and input, and three directions for offloading heavy processing.

HTTP caching and CDNs — designing Cache-Control

This chapter organizes the directives of Cache-Control by "who it applies to", "how long it stays fresh", and "what to do after expiry", and derives caching designs from the nature of the resource. It covers the differences between no-cache and no-store, max-age and s-maxage, where stale-while-revalidate and immutable belong, and why Vary is needed.

Indexes — the cost of making lookups faster

This chapter explains how indexes speed up lookups and the cost they impose on writes. It covers column order in composite indexes, patterns that stop indexes from being used, and how they differ from sharding and hashing.