This PR adds benchmarking capabilities to the lambda interpreter.
The benchmarks measure performance across all sample files in the samples folder.
This enables consistent performance testing and helps track optimization improvements over time.
Changes in this PR:
Added new bench target to Makefile for running Go benchmarks.
Created benchmark_test.go with sub-benchmarks for each sample file (Church, Fast, Saccharine, Simple, Thunk).
Used b.Run for organizing sample-specific sub-benchmarks and b.Loop for efficient iteration.
Configured benchmarks to use fixed iterations (10x) and 4 CPU cores for reproducible results.
Decisions
Used b.Loop() instead of traditional for i := 0; i < b.N; i++ pattern.
This is the modern Go benchmarking idiom that provides better performance measurement.
Benchmarks run the full pipeline (parse, compile, execute, stringify) to measure end-to-end performance for each sample.
Benefits
Provides quantitative performance metrics for the lambda interpreter.
Enables tracking performance improvements or regressions across different sample complexities.
Consistent benchmark configuration (fixed iterations, CPU cores) ensures reproducible results for comparison.
Checklist
Code follows conventional commit format.
Branch follows naming convention (<type>/<description>). Always use underscores.
Tests pass (if applicable).
Documentation updated (if applicable).
## Description
This PR adds benchmarking capabilities to the lambda interpreter.
The benchmarks measure performance across all sample files in the samples folder.
This enables consistent performance testing and helps track optimization improvements over time.
Changes in this PR:
- Added new `bench` target to Makefile for running Go benchmarks.
- Created `benchmark_test.go` with sub-benchmarks for each sample file (Church, Fast, Saccharine, Simple, Thunk).
- Used `b.Run` for organizing sample-specific sub-benchmarks and `b.Loop` for efficient iteration.
- Configured benchmarks to use fixed iterations (10x) and 4 CPU cores for reproducible results.
### Decisions
Used `b.Loop()` instead of traditional `for i := 0; i < b.N; i++` pattern.
This is the modern Go benchmarking idiom that provides better performance measurement.
Benchmarks run the full pipeline (parse, compile, execute, stringify) to measure end-to-end performance for each sample.
## Benefits
Provides quantitative performance metrics for the lambda interpreter.
Enables tracking performance improvements or regressions across different sample complexities.
Consistent benchmark configuration (fixed iterations, CPU cores) ensures reproducible results for comparison.
## Checklist
- [x] Code follows conventional commit format.
- [x] Branch follows naming convention (`<type>/<description>`). Always use underscores.
- [x] Tests pass (if applicable).
- [x] Documentation updated (if applicable).
Replace individual benchmark functions with a single BenchmarkSamples function.
Use b.Run to create sub-benchmarks for each sample file.
Update all benchmarks to use b.Loop instead of manual b.N iteration.
mvhutz
merged commit 609fe05250 into main2026-01-11 22:48:27 +00:00
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
Description
This PR adds benchmarking capabilities to the lambda interpreter.
The benchmarks measure performance across all sample files in the samples folder.
This enables consistent performance testing and helps track optimization improvements over time.
Changes in this PR:
benchtarget to Makefile for running Go benchmarks.benchmark_test.gowith sub-benchmarks for each sample file (Church, Fast, Saccharine, Simple, Thunk).b.Runfor organizing sample-specific sub-benchmarks andb.Loopfor efficient iteration.Decisions
Used
b.Loop()instead of traditionalfor i := 0; i < b.N; i++pattern.This is the modern Go benchmarking idiom that provides better performance measurement.
Benchmarks run the full pipeline (parse, compile, execute, stringify) to measure end-to-end performance for each sample.
Benefits
Provides quantitative performance metrics for the lambda interpreter.
Enables tracking performance improvements or regressions across different sample complexities.
Consistent benchmark configuration (fixed iterations, CPU cores) ensures reproducible results for comparison.
Checklist
<type>/<description>). Always use underscores.