Compares two profiling runs to show what changed. Useful for measuring the impact of optimizations.
Value
A list with:
summary: Overall comparison summaryby_function: Function-by-function comparisonimproved: Functions that got fasterregressed: Functions that got slower
Examples
p1 <- pv_example()
p2 <- pv_example()
pv_compare(p1, p2)
#> $summary
#> metric before after change
#> 1 Total time (ms) 70 70 +0 ms (+0.0%)
#> 2 Samples 14 14 +0
#> 3 Speedup 1 1 1.00x
#>
#> $by_function
#> label before_ms after_ms diff_ms pct_change
#> 1 rnorm 30 30 0 0
#> 2 x[i] <- rnorm(1) 20 20 0 0
#> 3 generate_data 15 15 0 0
#> 4 result[i] <- sqrt(abs(x[i])) * 2 5 5 0 0
#>
#> $improved
#> [1] label before_ms after_ms diff_ms pct_change
#> <0 rows> (or 0-length row.names)
#>
#> $regressed
#> [1] label before_ms after_ms diff_ms pct_change
#> <0 rows> (or 0-length row.names)
#>
