Skip to contents

Returns a detailed breakdown of time spent in different parts of the tree-building algorithm. Profiling must be enabled at compile time.

Usage

get_profile_report()

Value

A string containing the profiling report, or a message indicating profiling is not enabled.

Details

To enable profiling, the package must be compiled with the -DPROFILE_PHYLOBUILD flag. This can be done by adding PROFILE_PHYLOBUILD=1 to the PKG_CPPFLAGS in src/Makevars.

When profiling is enabled, the report shows:

  • Total time spent in each profiled section

  • Number of calls to each section

  • Average time per call

  • Percentage of total time

See also

reset_profile to clear profiling data

Examples

if (FALSE) { # \dontrun{
# Run some tree building operations
d <- matrix(runif(100*100), 100, 100)
d <- (d + t(d)) / 2
diag(d) <- 0
rownames(d) <- colnames(d) <- paste0("t", 1:100)

tree <- fast_nj(d)

# View profiling report
cat(get_profile_report())
} # }