feat: add benchmark target to Makefile #14
Reference in New Issue
Block a user
Delete Branch "feat/benchmark-target"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
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.