comp.lang.ada
 help / color / mirror / Atom feed
From: Simon Wright <simon@pushface.org>
Subject: Re: Benchmark Ada, please
Date: Sat, 05 Jul 2014 17:33:31 +0100
Date: 2014-07-05T17:33:31+01:00	[thread overview]
Message-ID: <lylhs7epes.fsf@pushface.org> (raw)
In-Reply-To: lp8rct$f4a$1@speranza.aioe.org

Guillaume Foliard <guifo@wanadoo.fr> writes:

I did much the same as you. I wish I'd started from the F90 version
rather than the C++ one, it's *much* cleaner.

> Here are the numbers with GNAT GPL 2014 on a Core2 Q9650 @ 3.00GHz:
>
> $ gnatmake -O3 rbc_ada.adb
> $ time ./rbc_ada
> ...
> Elapsed time is = 1.966112682
>
>
> As for the C++ version:
>
> $ g++ -o testc -O3 RBC_CPP.cpp
> $ time ./testc
> ... 
> Elapsed time is   = 3.12033
>
> So the Ada version is significantly faster. I suppose it is mainly because 
> the Ada compiler has vectorized more loops than the C++ compiler (add -
> ftree-vectorizer-verbose=2 to the above compilation commands to check by 
> yourself).

On Mac OS X (2.5 GHz Intel Core i5) I found the reverse, both with FSF
GCC 4.9.0 and GNAT GPL 2014; C++ took ~ 1s, Ada took ~ 2s.

With GCC 4.9.0, gfortran was approximately the same as C++.

Apple's C++ (Xcode 5.1.1) was approximately the same as GCC's.

-ftree-vectorizer-verbose=2 had no effect with FSF GCC.


  parent reply	other threads:[~2014-07-05 16:33 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-07-04 17:23 Benchmark Ada, please Victor Porton
2014-07-05 12:34 ` Guillaume Foliard
2014-07-05 13:00   ` Niklas Holsti
2014-07-05 17:00     ` Guillaume Foliard
2014-07-05 18:29       ` Niklas Holsti
2014-07-05 18:44         ` Niklas Holsti
2014-07-05 18:50         ` Guillaume Foliard
2014-07-05 19:09           ` Niklas Holsti
2014-07-05 16:33   ` Simon Wright [this message]
2014-07-05 18:25     ` Guillaume Foliard
2014-07-06 17:24   ` Dirk Heinrichs
replies disabled

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox