ArticleslgStudy

computer science

Incremental computing

Incremental computing is a computer science topic covered in the lgStudy science library. This page brings together a partial reference excerpt, illustrations, worked examples, real-world applications and a short study plan, so you can understand Incremental computing rather than just read about it. In short: Incremental computing, also known as incremental computation, is a software feature which, whenever a piece of data changes, attempts to save time by only recomputing those outputs which depend on the changed data. When incremental computing is successful, it can be significantly faster than computing new outputs naively.

Incremental computing — main illustration
Incremental computing — illustration

Key takeaways

  • Incremental computing belongs to computer science; place it in that map before memorising details.
  • Learn the definition first, then one example that makes the definition concrete.
  • Connect Incremental computing to a quantity you can measure, compute or draw — that is where exam questions come from.
  • Reproduce the core statement of Incremental computing from memory before moving on to harder problems.

Reference excerpt

Incremental computing, also known as incremental computation, is a software feature which, whenever a piece of data changes, attempts to save time by only recomputing those outputs which depend on the changed data. When incremental computing is successful, it can be significantly faster than computing new outputs naively. For example, a spreadsheet software package might use incremental computation in its recalculation features, to update only those cells containing formulas which depend (directly or indirectly) on the changed cells. An automated incremental computing tool is a specialised program analysis tool for optimization.

Static versus dynamic

Incremental computing techniques can be broadly classified into two types of approaches: Static approaches attempt to derive an incremental program from a conventional program P using, e.g., either manual design and refactoring, or automatic program transformations. These program transformations occur before any inputs or input changes are provided. Dynamic approaches record information about executing program P on a particular input (I1) and use this information when the input changes (to I2) in order to update the output (from O1 to O2). The figure shows the relationship between program P, the change calculation function ΔP, which constitutes the core of the incremental program, and a pair of inputs and outputs, I1, O1 and I2, O2.

Specialized versus general-purpose approaches Some approaches to incremental computing are specialized, while others are general purpose. Specialized approaches require the programmer to explicitly specify the algorithms and data structures that will be used to preserve unchanged sub-calculations. General-purpose approaches, on the other hand, use language, compiler, or algorithmic techniques to give incremental behavior to otherwise non-incremental programs.

Static methods

Program derivatives Given a computation C=f(x1,x2,…xn) and a potential change xj:=Δxj, we can insert code before the change occurs (the pre-derivative) and after the change (the post-derivative) to update the value of C faster than rerunning f. Paige has written down a list of rules for formal differentiation of programs in SUBSETL.

View maintenance In database systems such as DBToaster, views are defined with relational algebra. Incremental view maintenance statically analyzes relational algebra to create update rules that quickly maintain the view in the presence of small updates, such as insertion of a row.

Dynamic methods Incremental computation can be achieved by building a dependency graph of all the data elements that may need to be recalculated, and their dependencies. The elements that need to be updated when a single element changes are given by the transitive closure of the dependency relation of the graph. In other words, if there is a path from the changed element to another element, the latter may be updated (depending on whether the change eventually reaches the element). The dependency graph may need to be updated as dependencies change, or as elements are added to, or removed from, the system. It is used internally by the implementation, and does not typically need to be displayed to the user. Capturing dependencies across all possible values can be avoided by identifying subset of important values (e.g., aggregation results) across which dependencies can be tracked, and incrementally recomputing other dependent variables, hence balancing the amount of dependency information to be tracked with the amount of recomputation to be performed upon input change. Partial evaluation can be seen as a method for automating the simplest possible case of incremental computing, in which an attempt is made to divide program data into two categories: which can vary based on the program's input, and which cannot (and the smallest unit of change is simply "all the data that can vary"). Partial evaluation can be combined with other incremental computing techniques. With cycles in the dependency graph, a single pass through the graph may not be sufficient to reach a fixed point. In some cases, complete re-evaluation of a system is semantically equivalent to incremental evaluation, and may be more efficient in practice if not in theory.

Existing systems

Compiler and language support Automatic Incrementalization (also called "Self-Adjusting Computation", and "Adaptive Functional Programming"), Delta ML, Haskell Adaptive Cornell Synthesizer Generator IceDust - a custom domain-specific language.

Frameworks and libraries Adapton - with implementations in several languages One-way Dataflow Constraints (Reactive Computation in C++) Differential Dataflow Jane Street Incremental Incremental Datalog (LogicBlox) Incremental Prolog (XSB) FSharp.Data.Adaptive Domain-Specific Approaches: Incremental Type Checking.

Applications

Databases (view maintenance) Build systems Spreadsheets Development Environments Financial Computations Attribute Grammar Evaluation Graph Computations and Queries GUIs (e.g., React and DOM diffing) Scientific applications.

See also Reactive programming Functional reactive programming Memoization Bidirectional transformation

References

Illustrations

Incremental computing: Incremental computing derives a new input/output pair from one or more old input/output relationships. To do so, ΔP must relate a change in the input to a change in the output. The consumer of the result may be interested in the full updated output, or the delta output, or both.
Incremental computing derives a new input/output pair from one or more old input/output relationships. To do so, ΔP must relate a change in the input to a change in the output. The consumer of the result may be interested in the full updated output, or the delta output, or both.

Worked examples

Example 1 — a first encounter with Incremental computing

Start with the simplest possible case. Write down what Incremental computing claims or describes in one sentence, then invent the smallest concrete situation in which that sentence is true. In computer science, the smallest case is usually a single object, a single equation or a single measurement. Check that every symbol or term in your sentence has a meaning in that case.

Example 2 — changing one variable

Take the situation from Example 1 and change exactly one quantity: double it, halve it, or set it to zero. Predict what should happen to Incremental computing before you calculate. Comparing your prediction with the result is the fastest way to find out whether you understand the idea or only the words.

Example 3 — an exam-style question

Typical questions about Incremental computing ask you to (a) state it precisely, (b) apply it to given data, and (c) explain a limitation. Practise writing all three answers in under five minutes; the third part is what separates a full-mark answer from an average one.

Applications of Incremental computing

In research
Incremental computing appears in computer science research whenever the underlying quantities have to be modelled precisely. Papers usually cite it as a starting assumption and then explore where it breaks down.
In technology and industry
Engineering practice reuses Incremental computing in design rules, simulations and safety margins. Knowing the idea lets you read a specification sheet and understand why the numbers look the way they do.
In the classroom
Incremental computing is common in secondary-school and first-year university syllabi. It links to neighbouring topics Incremental computing, so understanding it makes those chapters shorter.
In everyday life
Look for Incremental computing outside the textbook — in sport, cooking, traffic, electronics or the sky above you. An example you found yourself is remembered far longer than one you were given.
Ask Teacher Smith questions about this articleOpens your AI tutor with a question about “Incremental computing” →

How to study Incremental computing in 20 minutes

  1. Read the reference excerpt below once, without taking notes.
  2. Close the page and write down what Incremental computing means in your own words.
  3. Compare your version with the excerpt and mark what you missed.
  4. Work through the three examples above with pen and paper.
  5. Explain Incremental computing out loud to somebody else — or to Teacher Smith in the lgStudy chat.

Frequently asked questions

What is Incremental computing in simple terms?

Incremental computing, also known as incremental computation, is a software feature which, whenever a piece of data changes, attempts to save time by only recomputing those outputs which depend on the changed data. When incremental computing is successful, it can be significantly faster than comput…

Why does Incremental computing matter?

Because it connects several computer science ideas at once: it gives you a definition you can apply, a quantity you can calculate, and a way to check whether a result is plausible.

How should I study Incremental computing?

Read the excerpt, restate it from memory, then work through the examples and applications listed on this page. The five-step study plan above takes about twenty minutes.

What does this page cover?

It gives you a compact reference excerpt plus original lgStudy explanations, examples, applications and study material on Incremental computing.

Tags

  • Incremental computing

Keep exploring