Archive for 2010-09-03

Fourteen patches to speed up R

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.

2010-09-03 at 4:12 pm 19 comments


Calendar

September 2010
M T W T F S S
 12345
6789101112
13141516171819
20212223242526
27282930  

Posts by Month

Posts by Category