<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/performance-improvements-coming-to-r-3-4-0/"></div></div><div></div></div><div></div></div>
<div>
(This article was first published on <strong><a href="http://blog.revolutionanalytics.com/2017/02/preview-r-340.html"> Revolutions</a></strong>, and kindly contributed to <a rel="nofollow" href="https://www.r-bloggers.com/">R-bloggers)</a> </div>
<div>
<p>R 3.3.3 (codename: &quot;Another Canoe&quot;) is <a target="_blank" rel="nofollow" href="https://stat.ethz.ch/pipermail/r-devel/2017-February/073705.html">scheduled for release on March 6</a>. This is the &quot;wrap-up&quot; release of the R 3.3 series, which means it will include minor bug fixes and improvements, but eschew major new features. Major changes are coming though, with the subsequent release of R 3.4.0. While the <a target="_blank" rel="nofollow" href="http://stat.ethz.ch/R-manual/R-devel/doc/html/NEWS.html">NEWS file announcing updates in 3.4.0</a> is still subject to change, it indicates several major changes aimed at improving the performance of R in various ways:</p>
<p><strong>A &quot;just-in-time&quot; JIT compiler will be included</strong>. While the core R packages have been byte-compiled <a target="_blank" rel="nofollow" href="http://blog.revolutionanalytics.com/2011/08/with-byte-compiler-r-214-will-be-even-faster.html">since 2011</a>, and package authors also have the option of btye-compiling the R code they contain, it was tricky for ordinary R users to gain the benefits of byte-compilation for their own code. In 3.4.0, loops in your R scripts and functions you write will be byte-compiled as you use them (&quot;just-in-time&quot;), so you can get improved performance for your R code without taking any additional actions.</p>
<p><strong>Linear algebra performance improvements</strong>. R uses a <a target="_blank" rel="nofollow" href="http://www.netlib.org/blas/">BLAS library</a> for high-performance implementations of many linear algebra routines like matrix multiplication, and now R will use faster routines in some situations (e.g. for matrix-vector multiplications). It will also be slightly faster for each call, by reducing the time to check whether the data include missing values (which BLAS generally doesn't handle). This should improve the performance of all R distributions, including those like <a target="_blank" rel="nofollow" href="https://mran.microsoft.com/documents/rro/multithread/">Microsoft R</a> that are bundled with multi-threaded BLAS libraries.</p>
<p><strong>Improvements for packages with compiled code</strong>. Many packages include code written in C or C++ (or even Fortran, still a <a target="_blank" rel="nofollow" href="https://arstechnica.com/science/2014/05/scientific-computings-future-can-any-coding-language-top-a-1950s-behemoth/">powerful language for scientific computing</a>) that is then called from R functions. R 3.4.0 will include a new system that allows package developers to choose to expose compiled functions to other packages or to keep them private. As a side benefit, this <a target="_blank" rel="nofollow" href="http://stat.ethz.ch/R-manual/R-devel/doc/manual/R-exts.html#Registering-native-routines">new &quot;registration&quot; system</a> will speed up the process of calling compiled functions, particularly on Windows systems. The gain is measured in the order of microseconds per call, but when these functions are called thousands or millions of times the impact can be noticable. The system also adds additional checks to make sure calls to compiled functions are structured correctly — a reliability check that has already detected potential bugs in dozens of packages already on CRAN.</p>
<p><strong>Accumulating vectors in a loop is faster</strong>. It's still a bad idea to extend the length of a vector with each iteration of a loop (it's a better idea to pre-allocate a vector of the needed length first), but code that follows that practice should now run faster thanks to R occasionally grabbing a bit more memory than needed. </p>
<p><strong>Performance improvements to other functions</strong>. Sorting vectors of numbers is faster (thanks to the use of the radix-sort algorithm by default). Tables with missing values compute quicker. Long strings no longer cause slowness in the <code>str</code> function. The <code>sapply</code> function is faster when applied to arrays with dimension names.</p>
<p>There are several other improvements not related to performance, as well:</p>
<ul>
<li>An updated version of the <a target="_blank" rel="nofollow" href="https://tcl.tk/">Tcl/Tk</a> graphics system in R for Windows.</li>
<li>More consistent handling of missing values when constructing tables.</li>
<li>Accuracy improvements for extreme values in some statistical functions.</li>
<li>Better detection and warning of likely programmer errors, like comparing a vector with a zero-length array.</li>
</ul>
<p>No release date has been provided for 3.4.0 provided by the R Core Group yet, but <a target="_blank" rel="nofollow" href="http://developer.r-project.org/">according to the R Developers page</a> it's likely to be available in mid-April. (That's not a guarantee though: issues with the wrap-up release have delayed major updates in the past.) But whenever it's available, R 3.4.0 looks to be a significant improvement for R users, especially those that care about performance.</p>
<p> </p>
</div>
<p>
<div>
<div>To <strong>leave a comment</strong> for the author, please follow the link and comment on their blog: <strong><a href="http://blog.revolutionanalytics.com/2017/02/preview-r-340.html"> Revolutions</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/LsmLW0PaWWI"></a></div>