From: Niklas Holsti <niklas.holsti@tidorum.invalid>
Subject: Re: Benchmark Ada, please
Date: Sat, 05 Jul 2014 15:00:55 +0200
Date: 2014-07-05T15:00:55+02:00 [thread overview]
Message-ID: <c1qb87F8n40U1@mid.individual.net> (raw)
In-Reply-To: <lp8rct$f4a$1@speranza.aioe.org>
On 14-07-05 14:34 , Guillaume Foliard wrote:
> Victor Porton wrote:
>
>> Somebody, write an Ada benchmark for this comparison of programming
>> languages:
>>
>> https://github.com/jesusfv/Comparison-Programming-Languages-Economics
>
> Here is it:
[most of code snipped]
> Cpu_Time_End := Ada.Execution_Time.Clock;
I have a question about this, see below.
> Ada.Text_IO.Put_Line
> ("Elapsed time is ="
> & Ada.Real_Time.To_Duration (Cpu_Time_End - Cpu_Time_Start)'Img);
> end Rbc_Ada;
> ---------------------------------------------------------------------
>
> This is mostly a line to line translation from RBC_CPP.cpp. I have
> added a few type declarations though.
>
>> It seems that C++ was the fastest (faster than Fortran), but Ada may be
>> even faster.
>
> 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
Are you sure that Ada.Execution_Time.Clock gives numbers that can be
compared with the get_cpu_time() function in the C++ version? For a
program running under an OS, it is not evident what should be included
in the "processor time" for a program (program loading, process
creation, interrupts, I/O, page faults, ...).
What did the "time" command output in your tests?
Just to be sure that the claim "Ada is faster" is really motivated.
Which would be very nice.
--
Niklas Holsti
Tidorum Ltd
niklas holsti tidorum fi
. @ .
next prev parent reply other threads:[~2014-07-05 13:00 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 [this message]
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
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