<p><div><div><div><div data-width="100" data-show-faces="false" data-send="true" data-layout="button_count" data-height="21" data-href="https://www.r-bloggers.com/benchmarkme-update/"></div></div><div></div></div><div></div></div>
<div>
(This article was first published on <strong><a href="https://csgillespie.wordpress.com/2017/01/09/benchmarkme-update/"> R – Why?</a></strong>, and kindly contributed to <a rel="nofollow" href="https://www.r-bloggers.com/">R-bloggers)</a> </div>
<p>When discussing how to speed up slow R code, my first question is what is your computer spec? It always surprises me when complex biological experiments, costing a significant amount of money, are analysed using a six year old laptop. A new desktop machine costs around £1000 and that money would be saved within a month in user time. Typically the more the RAM you have, the larger the dataset you can handle. However it’s not so obvious of the benefit of upgrading the processor.</p>
<p>To quantify the impact of the CPU on an analysis, I created the package <a target="_blank" rel="nofollow" href="https://github.com/csgillespie/benchmarkme">benchmarkme</a>. The aim of this package is to provide a set of benchmarks routines and data from past runs. You can then compare your machine, with other CPUs.</p>
<p>The package is now on CRAN and can be installed in the usual way</p>
<pre>install.packages(&quot;benchmarkme&quot;)</pre>
<p>The <strong>benchmark_std()</strong> function assesses numerical operations such as loops and matrix operations. This benchmark comprises of three separate benchmarks: <strong>prog</strong>, <strong>matrix_fun</strong>, and <strong>matrix_cal</strong>. If you have less than 3GB of RAM (run `<strong>get_ram()</strong>` to find out how much is available on your system), then you should kill any memory hungry applications, e.g. firefox, and set `<strong>runs = 1</strong>` as an argument.</p>
<p>To benchmark your system, use</p>
<pre>library(&quot;benchmarkme&quot;)
res = benchmark_std(runs = 3)
</pre>
<p>You can compare your results to other users via</p>
<pre>plot(res)</pre>
<p><a target="_blank" rel="nofollow" href="https://i2.wp.com/csgillespie.files.wordpress.com/2017/01/rplot01.png?ssl=1"><img sizes="(max-width: 600px) 100vw, 600px" data-image-description="" data-orig-file="https://i2.wp.com/csgillespie.files.wordpress.com/2017/01/rplot01.png?resize=456%2C334&amp;ssl=1" data-orig-size="600,439" data-image-title="rplot01" class="wp-image-1156" data-comments-opened="1" data-recalc-dims="1" data-attachment-id="1156" data-permalink="https://csgillespie.wordpress.com/2017/01/09/benchmarkme-update/rplot01/" data-medium-file="https://i2.wp.com/csgillespie.files.wordpress.com/2017/01/rplot01.png?resize=456%2C334&amp;ssl=1?w=300" data-large-file="https://i2.wp.com/csgillespie.files.wordpress.com/2017/01/rplot01.png?resize=456%2C334&amp;ssl=1?w=600" data-image-meta="{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;0&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;0&quot;,&quot;iso&quot;:&quot;0&quot;,&quot;shutter_speed&quot;:&quot;0&quot;,&quot;title&quot;:&quot;&quot;,&quot;orientation&quot;:&quot;0&quot;}" src="https://i2.wp.com/csgillespie.files.wordpress.com/2017/01/rplot01.png?resize=456%2C334&ssl=1"></a><br>
My laptop is ranked around 50 out of 300. However, relative to the fastest processor, there’s not much difference.</p>
<p>Finally upload your results for the benefit of other users</p>
<pre>## You can control exactly what is uploaded. See details below.
upload_results(res)</pre>
<h2>Shiny</h2>
<p>You can also compare your results using the <a target="_blank" rel="nofollow" href="https://jumpingrivers.shinyapps.io/benchmarkme/">Shiny</a> interface. Simply create a results bundle</p>
<pre> create_bundle(res, filename = &quot;results.rds&quot;)</pre>
<p>and upload to the <a target="_blank" rel="nofollow" href="https://jumpingrivers.shinyapps.io/benchmarkme/">webpage</a>.</p>
<h2>What’s uploaded</h2>
<p>Two objects are uploaded:</p>
<p>1. Your benchmarks from <strong>benchmark_std</strong> or <strong>benchmark_io</strong>;<br>
2. A summary of your system information (<strong>get_sys_details()</strong>).</p>
<p>The <strong>get_sys_details() </strong>returns:</p>
<p>– <strong>Sys.info()</strong>;<br>
– <strong>get_platform_info()</strong>;<br>
– <strong>get_r_version()</strong>;<br>
– <strong>get_ram()</strong>;<br>
– <strong>get_cpu()</strong>;<br>
– <strong>get_byte_compiler()</strong>;<br>
– <strong>get_linear_algebra()</strong>;<br>
– <strong>installed.packages()</strong>;<br>
– <strong>Sys.getlocale()</strong>;<br>
– The `benchmarkme` version number;<br>
– Unique ID – used to extract results;<br>
– The current date.</p>
<p>The function <strong>Sys.info()</strong> does include the user and nodenames. In the public release of the data, this information will be removed. If you don’t wish to upload certain information, just set the corresponding argument, i.e.</p>
<pre>upload_results(res, args = list(sys_info=FALSE))
</pre>
<p> <a target="_blank" rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/csgillespie.wordpress.com/1127/"><img alt="" src="http://feeds.wordpress.com/1.0/comments/csgillespie.wordpress.com/1127/" border="0"></a> <img alt="" src="https://i1.wp.com/pixel.wp.com/b.gif?resize=1%2C1&ssl=1" border="0" data-recalc-dims="1"></p>
<p>
<div>
<div>To <strong>leave a comment</strong> for the author, please follow the link and comment on their blog: <strong><a href="https://csgillespie.wordpress.com/2017/01/09/benchmarkme-update/"> R – Why?</a></strong>.</div>
<hr>
<a rel="nofollow" href="https://www.r-bloggers.com/">R-bloggers.com</a> offers <strong><a rel="nofollow" href="https://feedburner.google.com/fb/a/mailverify?uri=RBloggers">daily e-mail updates</a></strong> about <a title="The R Project for Statistical Computing" rel="nofollow" href="https://www.r-project.org/">R</a> news and <a title="R tutorials" rel="nofollow" href="https://www.r-bloggers.com/search/tutorial">tutorials</a> on topics such as: <a title="Data science" rel="nofollow" href="https://www.r-bloggers.com/search/data%20science">Data science</a>, <a title="Big Data" rel="nofollow" href="https://www.r-bloggers.com/search/Big%20Data">Big Data, <a title="R jobs" rel="nofollow" href="https://www.r-users.com/">R jobs</a>, visualization (<a title="ggplot and ggplot2 tutorials" rel="nofollow" href="https://www.r-bloggers.com/search/ggplot2">ggplot2</a>, <a title="Boxplots using lattice and ggplot2 tutorials" rel="nofollow" href="https://www.r-bloggers.com/search/boxplot">Boxplots</a>, <a title="Maps and gis" rel="nofollow" href="https://www.r-bloggers.com/search/map">maps</a>, <a title="Animation in R" rel="nofollow" href="https://www.r-bloggers.com/search/animation">animation</a>), programming (<a title="RStudio IDE for R" rel="nofollow" href="https://www.r-bloggers.com/search/RStudio">RStudio</a>, <a title="Sweave and literate programming" rel="nofollow" href="https://www.r-bloggers.com/search/sweave">Sweave</a>, <a title="LaTeX in R" rel="nofollow" href="https://www.r-bloggers.com/search/LaTeX">LaTeX</a>, <a title="SQL and databases" rel="nofollow" href="https://www.r-bloggers.com/search/SQL">SQL</a>, <a title="Eclipse IDE for R" rel="nofollow" href="https://www.r-bloggers.com/search/eclipse">Eclipse</a>, <a title="git and github, Version Control System" rel="nofollow" href="https://www.r-bloggers.com/search/git">git</a>, <a title="Large data in R using Hadoop" rel="nofollow" href="https://www.r-bloggers.com/search/hadoop">hadoop</a>, <a title="Web Scraping of google, facebook, yahoo, twitter and more using R" rel="nofollow" href="https://www.r-bloggers.com/search/Web+Scraping">Web Scraping</a>) statistics (<a title="Regressions and ANOVA analysis tutorials" rel="nofollow" href="https://www.r-bloggers.com/search/regression">regression</a>, <a title="principal component analysis tutorial" rel="nofollow" href="https://www.r-bloggers.com/search/PCA">PCA</a>, <a title="Time series" rel="nofollow" href="https://www.r-bloggers.com/search/time+series">time series</a>, <a title="finance trading" rel="nofollow" href="https://www.r-bloggers.com/search/trading">trading</a>) and more...
<img height="1" alt="" width="1" src="http://feeds.feedburner.com/~r/RBloggers/~4/nAuI8IYb9p4"></a></div>