comp.lang.ada
 help / color / mirror / Atom feed
From: "John B. Matthews" <nospam@nospam.invalid>
Subject: Re: C++ threads vs. Ada tasks - surprised
Date: Mon, 17 Aug 2009 11:20:57 -0400
Date: 2009-08-17T11:20:57-04:00	[thread overview]
Message-ID: <nospam-3BCF08.11205717082009@news.aioe.org> (raw)
In-Reply-To: f02a0d10-acaa-47d3-ade8-2e7bd4030bd8@d4g2000yqa.googlegroups.com

In article 
<f02a0d10-acaa-47d3-ade8-2e7bd4030bd8@d4g2000yqa.googlegroups.com>,
 Maciej Sobczak <see.my.homepage@gmail.com> wrote:

[...]
> My expectations were wrong, as the Ada version proved to be ~2x faster
> on my machine (with GNAT 4.4.0 and g++ 4.4.0, taken from the same
> package, both versions compiled with -O2).

FWIW, the version Ada appears to be ~25% faster on Mac OS 10.5.8 with 
gcc 4.3.4.

$ make cleaner run
rm -f *.o *.ali b~* core
rm -f *.s a.out atest ctest
Darwin 9.8.0; gcc 4.3.4
gnatmake atest -cargs -O2 -bargs -shared -largs -dead_strip
gcc -c -O2 atest.adb
gnatbind -shared -x atest.ali
gnatlink atest.ali -shared-libgcc -dead_strip
Darwin 9.8.0; gcc 4.3.4
g++ -O2 ctest.cpp -o ctest
time ./atest 500000
Executed  500000 iterations
        3.48 real         1.97 user         3.33 sys
time ./ctest 500000
Executed 500000 iterations
        4.58 real         2.91 user         5.02 sys

[...]

-- 
John B. Matthews
trashgod at gmail dot com
<http://sites.google.com/site/drjohnbmatthews>



  parent reply	other threads:[~2009-08-17 15:20 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-08-16 21:34 C++ threads vs. Ada tasks - surprised Maciej Sobczak
2009-08-17  7:12 ` Stephen Leake
2009-08-17  8:14   ` Maciej Sobczak
2009-08-17 19:44   ` vlc
2009-08-17  8:04 ` Frederik Sausmikat
2009-08-17  8:17   ` Maciej Sobczak
2009-08-17  8:28   ` Tomek Wałkuski
2009-08-17  9:39     ` Frederik Sausmikat
2009-08-17  9:44       ` Ludovic Brenta
2009-08-17 11:12 ` John McCabe
2009-08-17 15:20 ` John B. Matthews [this message]
2009-08-18 20:36 ` Ira Baxter
replies disabled

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