Raxol.Benchmark.MemoryDSL (Raxol v2.0.1)
View SourceEnhanced DSL for memory benchmarking with advanced assertions.
Phase 3 Implementation: Provides memory-specific assertions and analysis:
- assert_memory_peak/2 - Peak memory usage assertions
- assert_memory_sustained/2 - Sustained memory usage assertions
- assert_gc_pressure/2 - Garbage collection pressure assertions
- assert_memory_efficiency/2 - Memory efficiency assertions
- assert_no_memory_regression/2 - Memory regression detection
Usage: use Raxol.Benchmark.MemoryDSL
memory_benchmark "Terminal Operations" do
scenario "large_buffer", fn ->
create_large_buffer(1000, 1000)
end
assert_memory_peak :large_buffer, less_than: 50_000_000 # 50MB
assert_memory_sustained :large_buffer, less_than: 30_000_000 # 30MB
assert_gc_pressure :large_buffer, less_than: 10 # Max 10 GC collections
assert_memory_efficiency :large_buffer, greater_than: 0.7 # 70% efficiency
assert_no_memory_regression baseline: "v1.5.4"end
Summary
Functions
Asserts garbage collection pressure is below threshold.
Asserts memory efficiency is above threshold.
Asserts peak memory usage is below threshold.
Asserts sustained memory usage is below threshold.
Asserts no memory regression compared to baseline.
Executes a memory benchmark defined with the DSL.
Defines a memory benchmark suite.
Configures memory benchmark behavior.
Defines a memory benchmark scenario.
Types
Functions
Asserts garbage collection pressure is below threshold.
Asserts memory efficiency is above threshold.
Asserts peak memory usage is below threshold.
Asserts sustained memory usage is below threshold.
Asserts no memory regression compared to baseline.
Executes a memory benchmark defined with the DSL.
Defines a memory benchmark suite.
Configures memory benchmark behavior.
Defines a memory benchmark scenario.