From edd @end|ng |rom deb|@n@org  Thu Jun 13 17:14:15 2019
From: edd @end|ng |rom deb|@n@org (Dirk Eddelbuettel)
Date: Thu, 13 Jun 2019 10:14:15 -0500
Subject: [Rd] compiler flags for performance
In-Reply-To: <3cd16957-b4f0-6d32-25ed-c3b1ffa4f241@yahoo.co.uk>
References: <3cd16957-b4f0-6d32-25ed-c3b1ffa4f241@yahoo.co.uk>
Message-ID: <23810.26695.725131.693656@rob.eddelbuettel.com>


On 13 June 2019 at 16:05, lejeczek via R-devel wrote:
| I'd like to ask, and I believe this place here should be best as who can
| know better, if building R with different compilers and opt flags is
| something worth investing time into?
| 
| Or maybe this a subject that somebody has already investigated. If yes
| what then are the conclusion?
| 
| Reason I ask is such that, on Centos 7.6 with different compilers from
| stock repo but also from so called software collections, do not
| render(with flags for performance) an R binaries which would perform any
| better, according to R-benchmark-25 at least, then "vanilla" packages
| shipped from distro.
| 
| And that makes me curious - is it because R is such a case which is
| prone to any compiler performance optimizations?
| 
| Maybe there is more structured and organized way to conduct such
| different-compilers-optimizations benchmarks/test?
| 
| What do devel can say and advise with regards to compile-for-performance
| subject?

Of course you do that, and add those switches to ~/.R/Makeconf.  The
resulting binaries may become non-portable.

E.g. "at work" we use -march=native quite a bit but it means can't share
libraries from a beefier dev box with skinnier deployment boxen as they don't
have the same chipset even thought the are both x86_64 and use the same Linux
distro.  

As for which switches help in which way on different compiler: that is
probably best seen as a black box.  Time and profile locally, I no longer try
to generalize.   The newer 'link-time-optimizations' can help too, they
certainly make builds longer ...

Dirk

-- 
http://dirk.eddelbuettel.com | @eddelbuettel | edd at debian.org



[Rd] compiler flags for performance
Dirk Eddelbuettel