📊 R package for tracking performance metrics across git versions and branches.
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
R Minor edit to plot_PR() and README Sep 5, 2016
SampleFiles_TravisPR Minor edits to the Travis with Rperform files Aug 19, 2016
exec
images
inst Minor edit to compare_dir() and plot_PR() Aug 20, 2016
man Minor changes to code and documentation. Aug 8, 2016
tests
.Rbuildignore Minor edit to plot_PR() and README Sep 5, 2016
.gitignore Updated README and travis.yml Mar 7, 2016
.travis.yml Added animint to required github packages in .travis.yml Jun 29, 2016
DESCRIPTION add microbenchmark to required packages Jan 10, 2017
LICENSE.md Created LICENSE.md (GPL-3) Aug 15, 2016
NAMESPACE Minor bug solved in R/rep_metrics.R and some minor changes Jun 4, 2016
README.Rmd Updated README; added development note Dec 20, 2017
Rperform.Rproj Initial commit--Initiated R Package May 29, 2015

README.Rmd

Rperform

Build Status

NOTE: The project's development was on hold during 2017 but will resume from January 2018.

Rperform is a package that allows R developers to track quantitative performance metrics of their code. It focuses on providing changes in a package’s performance metrics, related to runtime and memory, over different git versions and across git branches. Rperform can be integrated with Travis-CI to do performance testing during Travis builds by making changes to the repo's .travis.yml file. It can prove to be particularly useful while measuring the possible changes which can be introduced by a pull request (PR).

For integrating Rperform with your travis build, check out the instructions provided on the Rperform Wiki.

For more information, tutorials and related blog posts, go through the Rperform wiki.

The project was initiated as a part of the Google Summer of Code 2015 program. Toby Dylan Hocking and Hadley Wickham were the mentors.
The project was accepted into the Google Summer of Code 2016 program. Joshua Ulrich and Toby Dylan Hocking were the mentors.

Installation

  • You can install the package from github using devtools*.
library(devtools)
install_github("analyticalmonk/Rperform")

or,

devtools::install_github("analyticalmonk/Rperform")

*Follow the instructions on the devtools README to install the latest version.

  • Build and install it using the command line.
git clone https://github.com/analyticalmonk/rperform/ Rperform
R CMD build Rperform
R CMD INSTALL <insert name of the built tar file>

Basic examples

For detailed information regarding Rperform's plotting functions, check out the Wiki.

IMPORTANT: The Rperform package requires you to set the current directory to the concerned git repository before using the functions.

> setwd(dir = "Path/to/repo")
  • The following example illustrates the use of the Rperform::plot_metrics() function on the git repository of the package stringr.
> setwd("./stringr")
> library(Rperform)
> plot_metrics(test_path = "tests/testthat/test-join.r", metric = "time", num_commits = 10, save_data = FALSE, save_plots = FALSE)

time plot

  • The following example illustrates the use of the Rperform::plot_branchmetrics() function on the git repository of the package stringr.
> setwd("./stringr")
> library(Rperform)
> plot_branchmetrics(test_path = "tests/testthat/test-interp.r", metric = "memory", branch1 = "rperform_test", branch2 = "master", save_data = F, save_plots = F)

memory plot

  • The following example illustrates the use of the Rperform::time_compare() and Rperform::mem_compare() functions on the git repository of the package stringr.
> setwd("./stringr")
> library(Rperform)
> time_compare(test_path = "./tests/testthat/test-dup.r", num_commits = 2)

                          test_name metric_name status  metric_val         msg_val           date_time
1           basic duplication works        time   pass 0.001797014 Can now use CRA 2015-01-08 14:09:43
2           basic duplication works        time   pass 0.001539050 Can now use CRA 2015-01-08 14:09:43
3           basic duplication works        time   pass 0.001545034 Can now use CRA 2015-01-08 14:09:43
4  0 duplicates equals empty string        time   pass 0.001019430 Can now use CRA 2015-01-08 14:09:43
5  0 duplicates equals empty string        time   pass 0.000784386 Can now use CRA 2015-01-08 14:09:43
6  0 duplicates equals empty string        time   pass 0.000766279 Can now use CRA 2015-01-08 14:09:43
7                        test-dup.r        time   pass 0.003555478 Can now use CRA 2015-01-08 14:09:43
8                        test-dup.r        time   pass 0.003118946 Can now use CRA 2015-01-08 14:09:43
9                        test-dup.r        time   pass 0.003106017 Can now use CRA 2015-01-08 14:09:43
10          basic duplication works        time   pass 0.001780849 Require latest  2015-01-08 14:03:37
11          basic duplication works        time   pass 0.001545568 Require latest  2015-01-08 14:03:37
12          basic duplication works        time   pass 0.001517300 Require latest  2015-01-08 14:03:37
13 0 duplicates equals empty string        time   pass 0.001028882 Require latest  2015-01-08 14:03:37
14 0 duplicates equals empty string        time   pass 0.000783847 Require latest  2015-01-08 14:03:37
15 0 duplicates equals empty string        time   pass 0.000771520 Require latest  2015-01-08 14:03:37
16                       test-dup.r        time   pass 0.003436051 Require latest  2015-01-08 14:03:37
17                       test-dup.r        time   pass 0.003130397 Require latest  2015-01-08 14:03:37
18                       test-dup.r        time   pass 0.003082713 Require latest  2015-01-08 14:03:37
> 
> Rperform::mem_compare(test_path = "./tests/testthat/test-join.r", num_commits = 1)

             test_name metric_name status metric_val         msg_val           date_time
11.1  basic case works     max_mem_mb   pass      0.040 Can now use CRA 2015-01-08 14:09:43
11.2  basic case works     leak_mb      pass      0.040 Can now use CRA 2015-01-08 14:09:43
11.3 NULLs are dropped     max_mem_mb   pass      0.044 Can now use CRA 2015-01-08 14:09:43
11.4 NULLs are dropped     leak_mb      pass      0.044 Can now use CRA 2015-01-08 14:09:43
11.5       test-join.r     max_mem_mb   pass      0.148 Can now use CRA 2015-01-08 14:09:43
11.6       test-join.r     leak_mb      pass      0.148 Can now use CRA 2015-01-08 14:09:43
12.1  basic case works     max_mem_mb   pass      0.040 Can now use CRA 2015-01-08 14:09:43
12.2  basic case works     leak_mb      pass      0.040 Can now use CRA 2015-01-08 14:09:43
12.3 NULLs are dropped     max_mem_mb   pass      0.044 Can now use CRA 2015-01-08 14:09:43
12.4 NULLs are dropped     leak_mb      pass      0.044 Can now use CRA 2015-01-08 14:09:43
12.5       test-join.r     max_mem_mb   pass      0.144 Can now use CRA 2015-01-08 14:09:43
12.6       test-join.r     leak_mb      pass      0.144 Can now use CRA 2015-01-08 14:09:43
13.1  basic case works     max_mem_mb   pass      0.040 Can now use CRA 2015-01-08 14:09:43
13.2  basic case works     leak_mb      pass      0.040 Can now use CRA 2015-01-08 14:09:43
13.3 NULLs are dropped     max_mem_mb   pass      0.048 Can now use CRA 2015-01-08 14:09:43
13.4 NULLs are dropped     leak_mb      pass      0.048 Can now use CRA 2015-01-08 14:09:43
13.5       test-join.r     max_mem_mb   pass      0.148 Can now use CRA 2015-01-08 14:09:43
13.6       test-join.r     leak_mb      pass      0.148 Can now use CRA 2015-01-08 14:09:43