powered by
Executes benchmark scenarios (defaults: 10, 1000, 100000 identifiers), evaluates threshold gates, and optionally writes a report artifact.
pc_benchmark_harness( fn, ids = NULL, scenario_sizes = c(10L, 1000L, 100000L), id_generator = NULL, chunk_sizes = c(25L, 100L, 1000L), parallel_options = c(FALSE), workers = NULL, thresholds = pc_default_benchmark_thresholds(), report_path = NULL, report_format = c("markdown", "csv", "rds"), ... )
An object of class `PubChemBenchmarkReport` containing `details` and `summary` tibbles.
Function applied by `pc_batch()`/`pc_benchmark()`.
Optional base identifier vector. If shorter than a scenario size, identifiers are recycled.
Integer vector of benchmark scenario sizes.
Optional function `function(n)` returning `n` identifiers.
Integer vector of chunk sizes evaluated per scenario.
Logical vector controlling parallel toggle.
Number of workers used when parallel is enabled.
Named list with optional elements `elapsed_sec` and `failed_chunk_ratio`. Each can be scalar or a named numeric vector keyed by scenario size.
Optional path to write report output.
One of `"markdown"`, `"csv"`, or `"rds"`.
Additional arguments passed to `fn`.
Scenario-level summaries include elapsed-time and failed-chunk-ratio gates, making this helper useful for CI performance regression checks.
report <- pc_benchmark_harness( fn = function(chunk_ids, ...) sum(chunk_ids), ids = 1:50, scenario_sizes = c(10L, 20L), chunk_sizes = c(5L), parallel_options = FALSE ) class(report)
Run the code above in your browser using DataLab