profile v1.0

0

Monthly downloads

0th

Percentile

Read, Manipulate, and Write Profiler Data

Defines a data structure for profiler data, and methods to read and write from the 'Rprof' and 'pprof' file formats.

Readme

profile

Travis build status Coverage status CRAN status

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

  • Files created by Rprof()
  • .proto files written by pprof -proto, these can also be read by pprof

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"))

Functions in profile

Name Description
profile-package profile: Read, Manipulate, and Write Profiler Data
read_rprof File I/O for profiler data
validate_profile Definition of the profile data format
No Results!

Last month downloads

Details

Date 2018-01-03
License MIT + file LICENSE
URL https://github.com/r-prof/profile, https://r-prof.github.io/profile
BugReports https://github.com/r-prof/profile/issues
Encoding UTF-8
LazyData true
RoxygenNote 6.0.1
Collate 'api.R' 'compat-purrr.R' 'pprof-from-ds.R' 'rprof-read.R' 'pprof-read.R' 'pprof-to-ds.R' 'rprof-write.R' 'pprof-write.R' 'profile-package.R' 'proto.R' 'rprof-from-ds.R' 'rprof-to-ds.R' 'utils.R'
NeedsCompilation no
Packaged 2018-01-03 22:26:28 UTC; muelleki
Repository CRAN
Date/Publication 2018-01-05 10:19:17 UTC

Include our badge in your README

[![Rdoc](http://www.rdocumentation.org/badges/version/profile)](http://www.rdocumentation.org/packages/profile)