Created
November 6, 2015 18:37
-
-
Save maptracker/4e30bc5fa89105a2fb4e to your computer and use it in GitHub Desktop.
Graphical benchmarks with #microbenchmark in #R
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Code to make random matrices: | |
source("https://gist.github.com/maptracker/07390983253758614ecc/raw/5995a7c1112420b64ff33dcb1e7dac679d05dbf9/randomMatrix.R") | |
library("microbenchmark") | |
library("ggplot2") | |
# Iterate 1000 times over solving three sizes of matrices | |
bench <- microbenchmark( "10x10" = solve( randomMatrix( 10 ) ), | |
"20x20" = solve( randomMatrix( 20 ) ), | |
"50x50" = solve( randomMatrix( 50 ) ), | |
times = 1000 ) | |
# Plot results: | |
autoplot(bench) | |
# Taken from: https://stackoverflow.com/questions/24451575/what-does-autoplot-microbenchmark-actually-plot |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Example output:
