[R] Which language is faster for numerical computation?

Matt Shotwell shotwelm at musc.edu
Thu Sep 9 16:17:40 CEST 2010


For the compiled languages, it depends heavily on the compiler. This
sort of comparison is rendered moot by the huge variety of compiler and
hardware specific optimizations. My suggestion is to use C, or possibly
C++ in conjunction with Rcpp, as these are most compatible with R. Also,
C and C++ are consistently rated highly (often in the top 3) in
popularity and use. Fortran is not. This would make a difference if you
want to collaborate or ask for help.

-Matt

On Thu, 2010-09-09 at 06:26 -0400, Christofer Bogaso wrote:
> Dear all, R offers integration mechanism with different programming
> languages like C, C++, Fortran, .NET etc. Therefore I am curious on,
> for heavy numerical computation which language is the fastest? Is
> there any study? I specially want to know because, if there is some
> study saying that C is the fastest language for numerical computation
> then I would change some of my R code into C.
> 
> Thanks for your time.
> 
> ______________________________________________
> R-help at r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
> and provide commented, minimal, self-contained, reproducible code.

-- 
Matthew S. Shotwell
Graduate Student 
Division of Biostatistics and Epidemiology
Medical University of South Carolina



More information about the R-help mailing list