Fourteen patches to speed up R

[This article was first published on Radford Neal's blog » R Programming, and kindly contributed to R-bloggers]. (You can report issue about the content on this page here)
Want to share your content on R-bloggers? click here if you have a blog, or here if you don't.

Following my discovery of two surprising inefficiencies in R, I’ve been inspired to spend much of the last two weeks looking for ways to speed it up. I’ve had quite a bit of success, both at finding ways to speed up particular functions, and at finding ways to reduce general interpretive overhead.

You can get my fourteen patches to the R source code here. I’d be interested in hearing how much it speeds up typical applications, on various machines. Of course, you need to be comfortable with installing R from source code to use these patches. For meaningful speed comparisons, you also need to be sure to compile the modified and unmodified versions of R with the same compiler, same options, etc.

There look to be some more places in the R source code where speed improvements are possible, but for now, I had better switch to preparing for the coming teaching term…

UPDATE: I discovered a bug in the vec-subset patch. The version you can get from here now has this fixed. I also split the vec-subset patch into patch-vec-subset and patch-subscript, since these two parts are really independent. So there are now fifteen patches.

To leave a comment for the author, please follow the link and comment on their blog: Radford Neal's blog » R Programming. offers daily e-mail updates about R news and tutorials about learning R and many other topics. Click here if you're looking to post or find an R/data-science job.
Want to share your content on R-bloggers? click here if you have a blog, or here if you don't.

Never miss an update!
Subscribe to R-bloggers to receive
e-mails with the latest R posts.
(You will not see this message again.)

Click here to close (This popup will not appear again)