Returns all profiling analysis in a single list for programmatic access. This is the primary function for AI agents and scripts that need comprehensive profiling data without printed output.
Arguments
- x
A profvis object from
profvis::profvis().- n
Maximum number of items to include in each category (default 10).
Value
A list containing:
total_time_ms: Total profiling time in millisecondstotal_samples: Number of profiling samplesinterval_ms: Sampling interval in millisecondshas_source: Whether source references are availableself_time: Data frame of functions by self-timetotal_time: Data frame of functions by total timehot_lines: Data frame of hot source lines (or NULL if no source refs)hot_paths: Data frame of hot call pathssuggestions: Data frame of optimization suggestionsgc_pressure: Data frame of GC pressure analysismemory: Data frame of memory allocation by functionmemory_lines: Data frame of memory allocation by line (or NULL)
Examples
p <- pv_example()
d <- pv_debrief(p)
names(d)
#> [1] "total_time_ms" "total_samples" "interval_ms" "has_source"
#> [5] "self_time" "total_time" "hot_lines" "hot_paths"
#> [9] "suggestions" "gc_pressure" "memory" "memory_lines"
d$self_time
#> label samples time_ms pct
#> 1 rnorm 6 30 42.9
#> 2 x[i] <- rnorm(1) 4 20 28.6
#> 3 generate_data 3 15 21.4
#> 4 result[i] <- sqrt(abs(x[i])) * 2 1 5 7.1
