liveBook · Manning

Precomputation

Also called precalculation

Precomputation is calculating results before they are needed so they can be reused later without repeating the calculation.

How 3 Manning books explain it

Microservices Patterns, Second Edition

The calculation of values in advance so they can be stored and retrieved rather than recomputed for each query.

How it is used
Uses precomputation as a CQRS view-schema choice for improving query efficiency while accounting for event-handler update costs.
How deep it goes
Explains the schema decision and its scale-related trade-offs, but does not detail a precomputation procedure.
Examples
Illustrates query-supporting restaurant latitude and longitude for a proximity filter.
What you can do after
Evaluate whether query scale justifies precomputation and related schema optimizations over a simpler normalized design.

Read how Microservices Patterns, Second Edition explains precomputation →

Latency

The calculation of results before they are needed so later operations can retrieve or reuse them without repeating expensive computation.

How it is used
Reduces latency by moving expensive computation out of latency-sensitive code paths.
How deep it goes
Develops build-time, startup, runtime-interval, lookup-table, stale-data, and incremental-update strategies.
Examples
Uses storage statistics involving filesystem or database queries, subscription quotas, discounts, forecasting, and periodic refreshes.
What you can do after
Apply it by choosing a precomputation time and serving stored results through a lookup instead of repeating expensive logic.

Read how Latency explains precomputation →

Machine Learning System Design

Precomputation performs a calculation before its result is needed so that later processing can reuse the stored result.

How it is used
Reduces feature-store read latency by calculating reusable features before dataset retrieval.
How deep it goes
Defines precomputation, then explains staged aggregation, reuse, overlapping windows, and batch/real-time serving tradeoffs.
Examples
Uses clicks, prices, revenue, item-day sums, and 7-, 14-, 30-, and 60-day aggregation windows.
What you can do after
Apply it via a feature store to reuse staged aggregates and combine them with real-time features.

Read how Machine Learning System Design explains precomputation →

Also covered in

What to know first

Related concepts

Questions about precomputation

What is precomputation?

Precomputation is calculating results before they are needed so they can be reused later without repeating the calculation.

Which Manning books explain precomputation?

Microservices Patterns, Second Edition, Latency and Machine Learning System Design.

What should I know before learning precomputation?

Manning books that teach precomputation usually introduce mean first.

What kinds of precomputation are there?

Kinds of precomputation include incremental processing.

What is precomputation also called?

Precomputation is also called precalculation.

These guides are generated from the text of Manning books by Manning's knowledge graph and link to the sections they draw on. The full books are available on liveBook and at manning.com.