The Fastest Systems Know What Data Is Allowed to Become
Hatched by min dulle
Aug 19, 2026
3 min read
2 views
83%
What if a large share of performance problems are not caused by slow code, but by data that was allowed to become vague?
A request arrives with one shape, gets transformed into another, acquires a few optional fields, passes through a serializer, enters a cache, and eventually reaches a browser that must guess what to do with it. By the time anyone asks why the system feels slow, the original uncertainty has been multiplied across every layer.
This suggests a more useful connection between two disciplines that are usually treated separately: data validation and performance engineering. A schema appears to be about correctness. Performance work appears to be about speed. In practice, both are attempts to control the same thing: the number of possible states a system must handle.
The central thesis is simple:
Performance improves when systems reduce unnecessary possibilities before those possibilities become work.
A schema is therefore more than a gatekeeper at the edge of an application. It can be a tool for limiting computational ambiguity. When designed well, it helps every downstream layer make stronger assumptions, allocate less defensively, serialize more predictably, cache more effectively, and fail earlier.
The hidden cost of letting data stay vague
Consider a small product card returned by an API. In theory, it contains an identifier, a title, a price, and an image URL. In reality, the response may sometimes contain a number as a string, sometimes omit the image, sometimes use null, and sometimes include a promotional object whose internal structure changes depending on the campaign.
None of these choices is automatically disastrous. The problem is that each variation creates another branch in the code that consumes the data.
A frontend may need logic like this:
const price = typeof item.price === "string"
? Number(item.price)
: item.price;
const imageUrl = item.image && item.image.url
? item.image.url
: "/placeholder.png";
const label = item.promotion && item.promotion.label
? item.promotion.label
: "";
One object has already produced several questions:
- Is the price a number or text?
- Is the image absent, null, or malformed?
- Does a promotion exist?
- If it exists, does it have the expected property?
- Can the client safely render the result?
Those questions consume processor time, but their larger cost is conceptual. They force the program to carry uncertainty through every operation. The data is not merely being processed. It is being interpreted, defended, normalized, and reinterpreted.
This is where validation and performance converge. A system with weak contracts pushes work outward. Every consumer pays a small tax for the producer's ambiguity. The tax may appear as conditional checks, object conversions, repeated validation, defensive copying, cache misses, layout changes, or extra network requests. Individually, these costs look too minor to prioritize. At scale, they form the texture of slowness.
A useful mental model is possibility pressure. Let P represent the number of plausible shapes a consumer must be prepared to handle. Let C represent the cost of handling each shape. As P grows, the code does not simply become more flexible. It becomes more branchy, harder to optimize, harder to cache, and harder to reason about.
Performance work often focuses on reducing C: make a loop faster, compress a file, optimize a query. Schema design can reduce P before the loop, file, or query is ever reached.
A schema is a performance boundary, not just a correctness rule
A schema describes what data may look like. That sounds static, but its real value is operational. It establishes which assumptions can safely be made by every participant in a system.
Imagine two API contracts.
The first says that status is a string. Consumers must accept any string, including `
Sources
Hatch New Ideas with Glasp AI 🐣
Glasp AI allows you to hatch new ideas based on your curated content. Let's curate and create with Glasp AI :)
Start Hatching 🐣