R version 4.6.0 beta (2026-04-12 r89879 ucrt) -- "Because it was There" Copyright (C) 2026 The R Foundation for Statistical Computing Platform: x86_64-w64-mingw32/x64 R is free software and comes with ABSOLUTELY NO WARRANTY. You are welcome to redistribute it under certain conditions. Type 'license()' or 'licence()' for distribution details. R is a collaborative project with many contributors. Type 'contributors()' for more information and 'citation()' on how to cite R or R packages in publications. Type 'demo()' for some demos, 'help()' for on-line help, or 'help.start()' for an HTML browser interface to help. Type 'q()' to quit R. > # This file is part of the standard setup for testthat. > # It is recommended that you do not modify it. > # > # Where should you do additional test configuration? > # Learn more about the roles of various files in: > # * https://r-pkgs.org/testing-design.html#sec-tests-files-overview > # * https://testthat.r-lib.org/articles/special-files.html > > library(testthat) > library(debrief) > > test_check("debrief") ## PROFILING SUMMARY Total time: 50 ms (5 samples @ 10 ms interval) Source references: available ### TOP FUNCTIONS BY SELF-TIME 20 ms ( 40.0%) deep 10 ms ( 20.0%) helper 10 ms ( 20.0%) inner 10 ms ( 20.0%) outer ### TOP FUNCTIONS BY TOTAL TIME 50 ms (100.0%) outer 30 ms ( 60.0%) inner 20 ms ( 40.0%) deep 10 ms ( 20.0%) helper ### HOT LINES (by self-time) 20 ms ( 40.0%) R/utils.R:5 x <- rnorm(1000) 10 ms ( 20.0%) R/helper.R:20 do_work() 10 ms ( 20.0%) R/main.R:10 result 10 ms ( 20.0%) R/main.R:15 z <- heavy_computation() ### HOT CALL PATHS 20 ms (40.0%) - 2 samples: outer (R/main.R:10) -> inner (R/main.R:15) -> deep (R/utils.R:5) 10 ms (20.0%) - 1 samples: outer (R/main.R:10) 10 ms (20.0%) - 1 samples: outer (R/main.R:10) -> helper (R/helper.R:20) 10 ms (20.0%) - 1 samples: outer (R/main.R:10) -> inner (R/main.R:15) ### MEMORY ALLOCATION (by function) 150.00 MB inner 100.00 MB deep 50.00 MB helper ### MEMORY ALLOCATION (by line) 150.00 MB R/main.R:15 z <- heavy_computation() 100.00 MB R/utils.R:5 x <- rnorm(1000) 50.00 MB R/helper.R:20 do_work() ### Next steps pv_focus(p, "deep") pv_source_context(p, "R/utils.R") pv_suggestions(p) pv_help() ## FLAME GRAPH (text) Total time: 50 ms | Width: 70 chars | Min: 2% [======================================================================] (root) 100% [======================================================================] outer (100.0%) [========================================== ] inner (60.0%) [============== ] helper (20.0%) [============================ ] deep (40.0%) Legend: [====] = time spent, width proportional to time ### Next steps pv_focus(p, "outer") pv_hot_paths(p) ## CONDENSED FLAME VIEW #################### 40.0% (2 samples) -> outer -> inner -> deep ########## 20.0% (1 samples) -> outer -> inner ########## 20.0% (1 samples) -> outer -> helper ########## 20.0% (1 samples) -> outer ### Next steps pv_focus(p, "deep") pv_hot_lines(p) ## FOCUS: inner ### Time Analysis Total time: 30 ms ( 60.0%) - time on call stack Self time: 10 ms ( 20.0%) - time at top of stack Child time: 20 ms ( 40.0%) - time in callees Appearances: 3 samples ### Called By 3 calls (100.0%) outer ### Calls To 2 calls ( 66.7%) deep ### Source Locations Hot lines (by self-time): 10 ms (20.0%) R/main.R:15 z <- heavy_computation() ### Source Context: R/main.R 10: result 11: } 12: 13: 14: > 15: z <- heavy_computation() ### Next steps pv_focus(p, "deep") pv_callers(p, "inner") pv_focus(p, "outer") pv_source_context(p, "R/main.R") Function 'nonexistent' not found in profiling data. Available functions (top 20 by time): outer inner deep helper Run pv_help() to see all available functions. ## DEBRIEF FUNCTIONS Use pv_help("category") to see functions in a specific category. Categories: overview, time, hotspots, memory, calls, source, visualization, comparison, diagnostics, export ### Overview pv_print_debrief(p) Print comprehensive profiling summary pv_debrief(p) Get all profiling data as a list pv_help() Show this help pv_example() Load example profvis data for testing ### Time Analysis pv_self_time(p) Functions by self-time (time at top of stack) pv_total_time(p) Functions by total time (including callees) ### Hot Spots pv_hot_lines(p) Hottest source lines by self-time pv_print_hot_lines(p) Print hot lines with source context pv_hot_paths(p) Most common call stack paths pv_print_hot_paths(p) Print hot paths in readable format pv_worst_line(p) Get the single hottest line with context ### Memory Analysis pv_memory(p) Memory allocation by function pv_memory_lines(p) Memory allocation by source line pv_print_memory(p) Print memory allocation summary ### Call Analysis pv_focus(p, "func") Deep dive into a specific function pv_callers(p, "func") Who calls this function? pv_callees(p, "func") What does this function call? pv_print_callers_callees(p, "func") Print caller/callee analysis pv_call_stats(p) Call counts and per-call timing pv_print_call_stats(p) Print call statistics table pv_call_depth(p) Time distribution by call stack depth pv_recursive(p) Detect recursive functions ### Source Context pv_source_context(p, "file.R") Show source with profiling overlay pv_file_summary(p) Time breakdown by source file pv_print_file_summary(p) Print file-level summary ### Visualization pv_flame(p) Text-based flame graph pv_flame_condense(p) Condensed flame graph view ### Comparison pv_compare(before, after) Compare two profiles pv_print_compare(before, after) Print profile comparison pv_compare_many(...) Compare multiple profiles pv_print_compare_many(...) Print multi-profile comparison ### Diagnostics pv_gc_pressure(p) Detect garbage collection overhead pv_print_gc_pressure(p) Print GC pressure analysis pv_suggestions(p) Get optimization suggestions pv_print_suggestions(p) Print actionable suggestions ### Export pv_to_list(p) Export as R list pv_to_json(p) Export as JSON string ### Typical Workflow 1. pv_print_debrief(p) -> Get overview, identify hot functions 2. pv_focus(p, "hot_func") -> Deep dive into the hottest function 3. pv_hot_lines(p) -> Find exact lines consuming time 4. pv_source_context(p, "file.R") -> See code with profiling overlay 5. pv_suggestions(p) -> Get optimization recommendations ## DEBRIEF FUNCTIONS ### Time Analysis pv_self_time(p) Functions by self-time (time at top of stack) pv_total_time(p) Functions by total time (including callees) ### Typical Workflow 1. pv_print_debrief(p) -> Get overview, identify hot functions 2. pv_focus(p, "hot_func") -> Deep dive into the hottest function 3. pv_hot_lines(p) -> Find exact lines consuming time 4. pv_source_context(p, "file.R") -> See code with profiling overlay 5. pv_suggestions(p) -> Get optimization recommendations Showing context around hottest line: 10 ## SOURCE: R/main.R Lines 1-15 (centered on 10) Time Mem Line Source - - 1: # Main file - - 2: outer <- function() { - - 3: x <- 1 - - 4: y <- 2 - - 5: inner() - - 6: } - - 7: - - 8: inner <- function() { - - 9: result <- deep() > 50 0.0 10: result - - 11: } - - 12: - - 13: - - 14: 30 150.0 15: z <- heavy_computation() ### Next steps pv_focus(p, "outer") pv_hot_lines(p) [ FAIL 0 | WARN 0 | SKIP 64 | PASS 366 ] ══ Skipped tests (64) ══════════════════════════════════════════════════════════ • On CRAN (64): 'test-call-analysis.R:18:1', 'test-call-analysis.R:69:1', 'test-call-analysis.R:101:1', 'test-call-analysis.R:131:1', 'test-compare.R:96:1', 'test-compare.R:151:1', 'test-compare.R:191:1', 'test-compare.R:196:1', 'test-compare.R:202:1', 'test-compare.R:207:1', 'test-debrief.R:47:1', 'test-debrief.R:52:1', 'test-diagnostics.R:53:1', 'test-diagnostics.R:58:1', 'test-diagnostics.R:92:1', 'test-diagnostics.R:97:1', 'test-diagnostics.R:197:1', 'test-empty-profile.R:24:1', 'test-empty-profile.R:48:1', 'test-flame.R:1:1', 'test-flame.R:6:1', 'test-flame.R:13:1', 'test-flame.R:33:1', 'test-flame.R:46:1', 'test-focus.R:1:1', 'test-focus.R:6:1', 'test-focus.R:38:1', 'test-focus.R:55:1', 'test-focus.R:76:1', 'test-focus.R:81:1', 'test-focus.R:102:1', 'test-help.R:6:1', 'test-help.R:15:1', 'test-help.R:19:1', 'test-help.R:23:1', 'test-help.R:27:1', 'test-help.R:31:1', 'test-help.R:35:1', 'test-help.R:39:1', 'test-help.R:43:1', 'test-help.R:47:1', 'test-hot-spots.R:77:1', 'test-hot-spots.R:82:1', 'test-hot-spots.R:87:1', 'test-hot-spots.R:97:1', 'test-memory.R:53:1', 'test-memory.R:58:1', 'test-memory.R:63:1', 'test-memory.R:94:1', 'test-memory.R:110:1', 'test-mock-structure.R:249:3', 'test-mock-structure.R:360:3', 'test-mock-structure.R:386:3', 'test-recursive.R:58:1', 'test-recursive.R:63:1', 'test-source-context.R:1:1', 'test-source-context.R:13:1', 'test-source-context.R:18:1', 'test-source-context.R:23:1', 'test-source-context.R:69:1', 'test-source-context.R:74:1', 'test-source-context.R:85:1', 'test-source-context.R:90:1', 'test-source-context.R:113:1' [ FAIL 0 | WARN 0 | SKIP 64 | PASS 366 ] > > proc.time() user system elapsed 8.01 1.12 9.17