[R] gcc 3.2 performance

RenE J.V. Bertin rjvbertin at hotmail.com
Tue Oct 22 18:00:18 CEST 2002


This is (slightly) off-topic, but may be of interest:

I've done some comparing of the overall performance obtained with gcc 3.2.0, compared to gcc 2.95.3 (linux/x86 platform). Has anybody done similar things, and/or does anybody have any comments on this? (Maybe be handled off-list AFAIAC.)

1) On simple benchmarks (dhrystone, "floating dhrystone", some of my own), 3.2 is faster than 2.95.3, but with -O2 only. With -O3, execution times on these can become 2x longer with 3.2 . This appears to be due to -finline-functions that is activated by -O3.

2) Comparison with my own graphing programme with its own expression language (with a byte compiler that that constructs call-graphs with functionpointers to the callbacks and other relevant info, probably not unlike the one in R). Here, 3.2 with -O3 is generally somewhat faster, but I found a single construct (calling a user-defined procedure using a user-supplied pointer to it) that takes almost 10x as long to evaluate with the 3.2 binary.

Specifically, concerning point 2): if sum is a procedure that evaluates add[$[0],$[1]] ($ being an array with the procedure's arguments) and v1,v2 are constants, sum[v1,v2] is very slightly slower with 3.2 than with 2.95.3 . call[&sum,v1,v1] with 2.95.3 takes as much time as evaluating just v1,v2 (sic!!), whereas with 3.2 it takes more than 50% more time than sum[v1,v2] (and evaluating v1,v2 is faster). In both cases, the procedure code *is* evaluated, and my "compiler" doesn't do loop optimising :)
I think that "flabbergasted" is a correct description of my state of mind in this...

R.B.
-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-
r-help mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html
Send "info", "help", or "[un]subscribe"
(in the "body", not the subject !)  To: r-help-request at stat.math.ethz.ch
_._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._



More information about the R-help mailing list