⚠️There's a newer version (1.0.3) of this package. Take me there.

profile

The goal of profile is to read and write files that contain run time profiling data. Currently, profile supports:

The data is available to the user for inspection and manipulation in a documented stable data format.

Installation

You can install profile from GitHub with:

# install.packages("remotes")
remotes::install_github("r-prof/profile")

Example

This simple example converts an .out file generated by Rprof() to the .proto format understood by pprof.

rprof_path <- tempfile("profile", fileext = ".out")
Rprof(rprof_path, line.profiling = TRUE)
x <- runif(1e6)
res <- vapply(x, function(x) if (x < 0.5) sqrt(x) else x * x, numeric(1))
Rprof(NULL)

library(profile)
ds <- read_rprof(rprof_path)
ds
#> Profile data: 33 samples
names(ds)
#> [1] "meta"         "sample_types" "samples"      "locations"   
#> [5] "functions"    ".rprof"
write_pprof(ds, file.path(tempdir(), "1.pb.gz"))

Copy Link

Version

Down Chevron

Install

install.packages('profile')

Monthly Downloads

266

Version

1.0

License

MIT + file LICENSE

Issues

Pull Requests

Stars

Forks

Maintainer

Last Published

January 5th, 2018

Functions in profile (1.0)