pub struct RuntimeCoverageOptimizationTarget {
pub cost_score: u64,
pub cost_basis: RuntimeCoverageCostBasis,
pub cognitive: u16,
pub cyclomatic: u16,
pub line_count: u32,
pub inner_iterations_per_call: Option<f64>,
}Expand description
Speed-work inputs for one hot function: how often it runs and how much
work each call does. importance ranks the risk of a change; this block
ranks where speed work gives the largest gain.
Fields§
§cost_score: u64invocations multiplied by the per-call cost that cost_basis names.
Uncapped integer. Compare it only between hot paths with the same
cost_basis: sort by cost_basis first, then by cost_score
descending. On the cognitive basis the per-call cost is at least 1.
cost_basis: RuntimeCoverageCostBasisWhich per-call cost the score uses.
cognitive: u16Static cognitive complexity of the function. A static proxy for the work per call, not a measurement.
cyclomatic: u16Static cyclomatic complexity of the function.
line_count: u32Number of lines in the function body.
inner_iterations_per_call: Option<f64>Peak executions of one block inside the function per call, from V8
block coverage. 1.0 means no block ran more than once per call. A
loop body that runs 3 times per call gives 3.0. Calls to other
functions do not change the value.
Omitted when the coverage input has no block counts for the function.