Newsgroups: comp.lang.java.programmer,comp.lang.java,comp.lang.functional,comp.lang.misc,comp.lang.smalltalk,comp.lang.c,comp.lang.c++
Path: cantaloupe.srv.cs.cmu.edu!bb3.andrew.cmu.edu!newsfeed.pitt.edu!newsflash.concordia.ca!news.nstn.ca!ott.istar!istar.net!van.istar!west.istar!uniserve!van-bc!news.iceonline.com!Newsposter
From: Vlad <vladimip@iceonline.com>
Subject: Re: Three languages: A performance comparison
Content-Type: text/plain; charset=us-ascii
To: David James Hanley <dhanle2@icarus.cc.uic.edu>
Sender: Newsposter@iceonline.com (Newsposter)
Content-Transfer-Encoding: 7bit
Nntp-Posting-Host: ns.iceonline.com
Organization: ICE Online Internet news
Message-ID: <31FBC0F5.1ACB4C92@iceonline.com>
References: <4te7rg$287o@piglet.cc.uic.edu>
X-Mailer: Mozilla 3.0b4Gold (X11; I; Linux 2.0.0 i586)
Mime-Version: 1.0
Date: Sun, 28 Jul 1996 19:35:17 GMT
Lines: 53
Xref: glinda.oz.cs.cmu.edu comp.lang.java.programmer:2341 comp.lang.java:71910 comp.lang.functional:7639 comp.lang.misc:26347 comp.lang.smalltalk:41478 comp.lang.c:198707 comp.lang.c++:202661

[cc'ed to original poster too]

Hi David,

David James Hanley wrote:
[....................]
>         The program caries out some basic arithmetic operations
> with a datatype that manipulates arbitrarily large integers.
> I used this example because it is of interest to me, for a project
> that I am working on.  Different benchmarks will of course yeild
> different results.

> Finally, here are the results:
> (in seconds)
>                    Taking large       summing
>                    powers of 2        large numbers.
> ----------------------------------------------------
>         java :       15.32             3.89
>         C++  :       22.79            51.3
>         SML  :        7.0              2.2
>         (Times are the average of 3 runs, on an unloaded machine
>          the times match almost identically, so I feel confident of them)

I pasted your source into a file, compiled it and ran it on my LiNUX box. :)
That's what I got:

1.Compiling with optimizations:

[root@borg /]# g++ -m486 -Wall -O -o integer integer.cc
integer.cc:113: warning: return type for `main' changed to integer type

2.Running:

[root@borg /]# integer
Computing the big powers took 7.01 seconds.
Summing them took 19.03 seconds.

A description of the system: RedHat LiNUX 3.0.3, kernel 2.0, on i586-66Mhz,
56Mb RAM. GNU G++ 2.7.2. I ran your program 5 times with pretty much the 
same results. Note that my CPU is heavily loaded, X-windows, Netscape,
5 xterms, PPP connection, news downloading etc etc ..

If you'd like, I could install Java compilers and check it too.

Regards,

Vlad

-- 
         #include <disclaimer.h>
-=-=-=-=-=-=-vladimip@iceonline.com-=-=-=-=-=-
 -=-=-=Good pings come in small packets=-=-=-
        -Vancouver, British Columbia-
