Blog Archives

New patches to speed up R 2.13.0

June 9, 2011
By
New patches to speed up R 2.13.0

I have now released a new collection of 30 patches to speed up R version 2.13.0. You can get them here Assessing how much these patches speed up R is difficult. First of all, the speedup varies tremendously with the type of program. It also varies quite a bit with the machine and compiler used

Read more »

Slowing down matrix multiplication in R

May 21, 2011
By
Slowing down matrix multiplication in R

After I realized that some aspects of R’s implementation are rather inefficient, one of the first things I looked at was matrix multiplication.  There I found a huge performance penalty for many matrix multiplies, a penalty which remains in the current version, 2.13.0.  As discussed below, eliminating this penalty speeds up long vector dot products

Read more »

Speed tests for R — and a look at the compiler

May 13, 2011
By
Speed tests for R — and a look at the compiler

I’ve gotten back to work on speeding up R, starting with improving my suite of speed tests.  Among other new features, this suite allows one to easily try out the “byte-code” compiler that is now a standard part of the latest release of R, version 2.13.0. You can get the suite here. I’ve been running

Read more »

Fourteen patches to speed up R

September 3, 2010
By
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

Read more »

Speeding up parentheses (and lots more) in R

August 19, 2010
By
Speeding up parentheses (and lots more) in R

As I noted here, enclosing sub-expressions in parentheses is slower in R than enclosing them in curly brackets. I now know why, and I’ve modified R to reduce (but not eliminate) the slowness of parentheses. The modification speeds up many other operations in R as well, for an average speedup of something like 5% for

Read more »

Two Surpising Things about R

August 14, 2010
By
Two Surpising Things about R

I see that it’s been over a year since my last post!  I have a backlog of blog post ideas, but something else always seems to have higher priority.   Today, though, I have some interesting (and useful) things to say about R, which I discovered in the last few days, and which shouldn’t take long

Read more »

Design Flaws in R #3 — Zero Subscripts

September 21, 2008
By
Design Flaws in R #3 — Zero Subscripts

Unlike the two design flaws I posted about before (here, here, and also here), where one could at least see a reason for the design decision, even if it was unwise, this design flaw is just  incomprehensible.  For no reason at all that I can see, R allows one to use zero as a subscript

Read more »

R Design Flaws #1 and #2: A Solution to Both?

August 25, 2008
By
R Design Flaws #1 and #2:  A Solution to Both?

I’ve previously posted about two design flaws in R. The first post was about how R produces reversed sequences from a:b when a>b, with bad consequences in “for” statements (and elsewhere). The second post was about how R by default drops dimensions in expressions like M when i:j is a sequence only one long (ie,

Read more »

Design Flaws in R #2 — Dropped Dimensions

August 19, 2008
By
Design Flaws in R #2 — Dropped Dimensions

In a comment on my first post on design flaws in the R language, Longhai remarked that he has encountered problems as a result of R’s default behaviour of dropping a dimension of a matrix when you select only one row/column from that dimension. This was indeed the design flaw that I was going to

Read more »

Design Flaws in R #1 — Reversing Sequences

August 6, 2008
By
Design Flaws in R #1 — Reversing Sequences

The R language for statistical computing has become the standard for academic statistical research, for the very good reason that it’s better than the alternatives. It’s far from perfect however. I could come up with a long “wish list” of desired features it lacks, but that’s not what I’ll do in this series of posts.

Read more »