Raxol.Test.PerformanceHelper (Raxol v0.4.0)
View SourceProvides utilities for performance testing and benchmarking in Raxol.
This module includes:
- Benchmarking utilities
- Performance test setup and teardown
- Common performance test scenarios
- Metrics collection and reporting
Summary
Functions
Asserts that a set of concurrent operations' average execution time is below a threshold.
Asserts that an operation's memory usage is below a threshold.
Asserts that an operation's average execution time is below a threshold. Use this for direct operation timing, not for benchmark result structs.
Asserts that a benchmark meets performance requirements.
Measures and asserts both time and memory performance.
Runs a benchmark with the given function and options.
Calculates the nth percentile from a list of times.
Formats benchmark results for human-readable output.
Measures the average execution time of an operation over multiple iterations. Returns the average time in milliseconds.
Measures memory usage of an operation. Returns {memory_in_bytes, result}.
Measures the execution time of an operation. Returns {time_in_ms, result}.
Sets up a test environment optimized for performance testing.
Functions
Asserts that a set of concurrent operations' average execution time is below a threshold.
Asserts that an operation's memory usage is below a threshold.
Asserts that an operation's average execution time is below a threshold. Use this for direct operation timing, not for benchmark result structs.
Asserts that a benchmark meets performance requirements.
Options
:max_average_time
- Maximum allowed average time in microseconds:max_p95_time
- Maximum allowed 95th percentile time in microseconds:min_iterations
- Minimum number of iterations required
Measures and asserts both time and memory performance.
Runs a benchmark with the given function and options.
Options
:iterations
- Number of iterations to run (default: 1000):warmup
- Number of warmup iterations (default: 100):timeout
- Maximum time to run in milliseconds (default: 5000)
Calculates the nth percentile from a list of times.
Formats benchmark results for human-readable output.
Measures the average execution time of an operation over multiple iterations. Returns the average time in milliseconds.
Measures memory usage of an operation. Returns {memory_in_bytes, result}.
Measures the execution time of an operation. Returns {time_in_ms, result}.
Sets up a test environment optimized for performance testing.
Returns a context map with initialized services and performance monitoring.