Topics / Lazy evaluation
Performance topic
Lazy evaluation
Do work only when a result is needed: deferred parsing, on-demand loading, lazy initialization and copy-on-write.
1,354proven techniques
51pitfalls: tried, then slower
679repositories
132from papers
Examples from real commits
MeshInspector/MeshLib
8×
Enumerate terms of a*b - c*d in increasing degree with a heap over rows, summing equal degrees, and stop at the first nonzero sum.
proof: commit →
WebKit/WebKit
5×
Point fresh WeakMap/WeakSet at a shared immortal zeroed buffer with capacity 1; allocate a real buffer only on first add.
proof: commit →
rust-lang/rust
2×
Mark crate as mostly unused so all non-extern, non-inline(never) functions are cross-crate-inlinable, deferring codegen until a downstream crate references them.
proof: commit →
Languages
- C++571
- C203
- Rust170
- Python124
- Go63
- Java21
Hardware
- CPU244
- x8691
- NVIDIA GPU82
- GPU72
- ARM41
Fields
- general471
- data & compression264
- graphics198
- compilers133
- math103
Where these come from
Repositories with the most techniques on this topic in the database:
AcademySoftwareFoundation/OpenShadingLanguage · 7angr/angr · 7crewAIInc/crewAI · 6Velocidex/velociraptor · 6Slicer/SlicerGitSVNArchive · 6BurntSushi/ripgrep · 6WebKit/WebKit · 6servo/servo · 6cvc5/cvc5 · 6x64dbg/x64dbg · 6
Ask Claude for the full answer
Each technique comes with its bottleneck, measured speedup, trade-offs, conditions and the commit or paper behind it, served to Claude through MCP.
claude mcp add --transport http adtomic https://www.adtomic.co/mcp
Related topics
Zero-copyBranchless programmingInlining and devirtualizationLookup tablesCache locality and data reordering