digitalmars.D - D performance compared to C++/Heron (take 2)
- christopher diggins (14/14) May 13 2004 I wrote a new program for comparing the efficiency with which Heron hand...
- Zz (9/23) May 13 2004 I just tried your benchmark on my machine the time is 219 for D but with
- Zz (7/21) May 13 2004 Extra note:
- hellcatv hotmail.com (6/20) May 13 2004 I haven't had a chance to look at it more carefully but valgrind itself ...
- Walter (9/19) May 13 2004 handles
- Walter (1/8) May 13 2004 It's a dmc bug. Oops.
- KTC (15/20) May 14 2004 Been meaning to ask this for ages, this seem as good a time as any so he...
- Walter (4/21) May 14 2004 program
- C. Sauls (28/28) May 14 2004 Moving up to DMD 0.86 seems to improve its performance, but I might be
I wrote a new program for comparing the efficiency with which Heron handles polymorphic objects in comparison to C++ and D and put it at http://www.heron-language.com/benchmarks/index.html . I tried to take into account the many excellent suggestions brought in from the earlier discussion. As before I would like feedback on how to keep the comparison fair and accurate for the given example. On a related note: The DMC compiler created very efficient code but two issues came up, it seems to choke on a delete[] function for the C++ example, so I would appreciate if any one could tell me whether it is a bug my code or DMC. The other issue is the DMC has problems with namespaces. -- Christopher Diggins http://www.cdiggins.com http://www.heron-language.com
May 13 2004
I just tried your benchmark on my machine the time is 219 for D but with VS7.1 the C++ is aprox double that of D as for heron the time is 15 using the above compiler. I never thought of comparing D with VS and the results supprised me. Zz "christopher diggins" <cdiggins users.sourceforge.net> wrote in message news:c80cdu$9l4$1 digitaldaemon.com...I wrote a new program for comparing the efficiency with which Heronhandlespolymorphic objects in comparison to C++ and D and put it at http://www.heron-language.com/benchmarks/index.html . I tried to take into account the many excellent suggestions brought in from the earlier discussion. As before I would like feedback on how to keep the comparison fair and accurate for the given example. On a related note: The DMC compiler created very efficient code but two issues came up, it seems to choke on a delete[] function for the C++ example, so I would appreciate if any one could tell me whether it is abugmy code or DMC. The other issue is the DMC has problems with namespaces. -- Christopher Diggins http://www.cdiggins.com http://www.heron-language.com
May 13 2004
Extra note: Executable from D was smaller: 77.340 vs 94.208 and i'm using D 0.86 Zz "christopher diggins" <cdiggins users.sourceforge.net> wrote in message news:c80cdu$9l4$1 digitaldaemon.com...I wrote a new program for comparing the efficiency with which Heronhandlespolymorphic objects in comparison to C++ and D and put it at http://www.heron-language.com/benchmarks/index.html . I tried to take into account the many excellent suggestions brought in from the earlier discussion. As before I would like feedback on how to keep the comparison fair and accurate for the given example. On a related note: The DMC compiler created very efficient code but two issues came up, it seems to choke on a delete[] function for the C++ example, so I would appreciate if any one could tell me whether it is abugmy code or DMC. The other issue is the DMC has problems with namespaces. -- Christopher Diggins http://www.cdiggins.com http://www.heron-language.com
May 13 2004
I haven't had a chance to look at it more carefully but valgrind itself doesn't turn up anything (that usually catches array overruns and malloc problems) but valgrind doesn't always catch things (in toy examples like this it invariably does) --Daniel In article <c80cdu$9l4$1 digitaldaemon.com>, christopher diggins says...I wrote a new program for comparing the efficiency with which Heron handles polymorphic objects in comparison to C++ and D and put it at http://www.heron-language.com/benchmarks/index.html . I tried to take into account the many excellent suggestions brought in from the earlier discussion. As before I would like feedback on how to keep the comparison fair and accurate for the given example. On a related note: The DMC compiler created very efficient code but two issues came up, it seems to choke on a delete[] function for the C++ example, so I would appreciate if any one could tell me whether it is a bug my code or DMC. The other issue is the DMC has problems with namespaces. -- Christopher Diggins http://www.cdiggins.com http://www.heron-language.com
May 13 2004
"christopher diggins" <cdiggins users.sourceforge.net> wrote in message news:c80cdu$9l4$1 digitaldaemon.com...I wrote a new program for comparing the efficiency with which Heronhandlespolymorphic objects in comparison to C++ and D and put it at http://www.heron-language.com/benchmarks/index.html . I tried to take into account the many excellent suggestions brought in from the earlier discussion. As before I would like feedback on how to keep the comparison fair and accurate for the given example. On a related note: The DMC compiler created very efficient code but two issues came up, it seems to choke on a delete[] function for the C++ example, so I would appreciate if any one could tell me whether it is abugmy code or DMC. The other issue is the DMC has problems with namespaces.D doesn't have a problem with namespaces. Replace #include <iostream.h> (which predates namespaces) with: #include <iostream> which is the standard version and compile with -I\dm\stlport\stlport
May 13 2004
"christopher diggins" <cdiggins users.sourceforge.net> wrote in message news:c80cdu$9l4$1 digitaldaemon.com...It's a dmc bug. Oops.On a related note: The DMC compiler created very efficient code but two issues came up, it seems to choke on a delete[] function for the C++ example, so I would appreciate if any one could tell me whether it is abugmy code or DMC.
May 13 2004
"Walter" wrote...D doesn't have a problem with namespaces. Replace #include <iostream.h> (which predates namespaces) with: #include <iostream> which is the standard version and compile with -I\dm\stlport\stlportBeen meaning to ask this for ages, this seem as good a time as any so here goes: One of the main selling point of DMC is it's build time and exec speed & size. However, if one want to use the standard library with namespace, one need to use STLport. How come the size of the output from DMC ballon from ~70KB to ~350KB if one change from using <iostream.h> to <iostream> & -I\dm\stlport\stlport\. ? Is there something I'm not doing that could reduce the size of a program that uses the standard library back down? Cheers, KTC -- Experience is a good school but the fees are high. - Heinrich Heine
May 14 2004
"KTC" <me here.com> wrote in message news:c828g4$309a$1 digitaldaemon.com..."Walter" wrote...&D doesn't have a problem with namespaces. Replace #include <iostream.h> (which predates namespaces) with: #include <iostream> which is the standard version and compile with -I\dm\stlport\stlportBeen meaning to ask this for ages, this seem as good a time as any so here goes: One of the main selling point of DMC is it's build time and exec speedsize. However, if one want to use the standard library with namespace, one need to use STLport. How come the size of the output from DMC ballon from ~70KB to ~350KB if one change from using <iostream.h> to <iostream> & -I\dm\stlport\stlport\. ? Is there something I'm not doing that could reduce the size of aprogramthat uses the standard library back down?That's one reason why I don't like <iostream>.
May 14 2004
Moving up to DMD 0.86 seems to improve its performance, but I might be wrong. Also, just for sakes, you might rewrite the D code to be more, well.. D-ish. :) Something like the following: ------------------------------ void main() { const int SIZE = 1000; float nMsecElapsed; d_time tStart, tElapsed; Indexer[SIZE] a; foreach (inout Indexer x; a) x = new Indexer; printf("size of array (bytes) = %d\n",(a[0].classinfo.init.length * SIZE) + (a[0].size * SIZE)); tStart = getUTCtime(); foreach (Indexer x; a) RunTest(x); tElapsed = getUTCtime() - tStart; nMsecElapsed = (cast(float)tElapsed / cast(float)TicksPerSecond) * 1000.0; printf("time elapsed (msec) = %f\n", nMsecElapsed); } ------------------------------ Note the use of an actual array instead of a pointer, and of foreach. I tried compiling this, and it made absolutely zero difference in EXE size or speed. Not that I really expected any. -C. Sauls -Invironz
May 14 2004