01 / 01

A library for incremental computations

Incremental

Jane Street

Hacker News • 166 points

02

What is Incremental?

Understanding the core concept behind efficient recomputation

Efficient Recomputation

Incremental is a library that helps you build computations that can be updated efficiently when their inputs change. Instead of recomputing everything from scratch, it tracks dependencies and only recalculates what's actually affected by the change.

Compute smarter, not harder

Core Capabilities

account_tree

Automatic Dependency Tracking

Builds computation graphs automatically without manual bookkeeping

speed

Minimal Recomputation

Only recomputes values affected by input changes

memory

Memory Efficient

Shares computation results across dependent nodes

verified

Production Ready

Battle-tested in Jane Street's trading systems

05

Technical Insights

How incremental computation works under the hood

How It Works

1

Define Computation

Express your computation as a graph of dependent values

2

Track Dependencies

Library automatically builds the dependency graph

3

Propagate Changes

When input changes, updates flow through the graph

4

Recompute Selectively

Only affected nodes are recalculated, saving time

Traditional vs Incremental Approach

Traditional
  • Recompute everything on change
  • O(n) complexity per update
  • Wasted CPU cycles
  • Scales poorly with size
Incremental Efficient
  • Recompute only what changed
  • O(changed) complexity
  • Minimal work required
  • Scales with data complexity

Thank You

Explore Incremental and start building efficient computations

github.com/janestreet/incremental
Made with AirSlide
𝕏 in