# Lazy Evaluation

Record: `arch:lazy-evaluation`
Kind: approach
Layer: [Execution Core](https://banes-lab.com/records/layer/execution-core.md)
Severity: contextual
Scope: computation, collection, stream
Canonical: https://banes-lab.com/ontology#arch-lazy-evaluation

## Repair

- Refactored by: Use Iterator/Generator, Defer Computation
- Detected by: eager loading of large unused data
- Violated by: computing/materializing unused results
- Measured by: avoided work, memory reduction
- Enforced by: performance tests

## requires

- [Deferred Execution Semantics](https://banes-lab.com/records/lex/deferred-execution-semantics.md)

## reinforces

- [Memory Efficiency](https://banes-lab.com/records/arch/memory-efficiency.md)

## enables

- [Avoiding Unneeded Work](https://banes-lab.com/records/lex/avoiding-unneeded-work.md)

## tensions-with

- [Debuggability/Resource Lifetime](https://banes-lab.com/records/lex/debuggability-resource-lifetime.md)
- [Eager Full Materialization](https://banes-lab.com/records/lex/eager-full-materialization.md)

## tensions

- [Lazy Evaluation Debuggability/Resource Lifetime](https://banes-lab.com/records/tension/debuggability-resource-lifetime-lazy-evaluation.md)
- [Lazy Evaluation Eager Full Materialization](https://banes-lab.com/records/tension/eager-full-materialization-lazy-evaluation.md)
