comp.lang.ada
 help / color / mirror / Atom feed
From: andreatta@mail.chem.sc.edu (Dan Andreatta)
Subject: Re: compiler benchmark comparisons
Date: 1 Mar 2002 15:17:56 -0800
Date: 2002-03-01T23:17:57+00:00	[thread overview]
Message-ID: <338040f8.0203011517.5a1ebdeb@posting.google.com> (raw)
In-Reply-To: 5ee5b646.0202282107.6f3dd89a@posting.google.com

> examples like this in detail, we discover that what
> people think are "identical" programs are in fact totally different

Er... you are right. (At this time Google hasn't reported any reply). 
I did some more experiments, and the bottleneck for the compiler was
in the genration of the code for Integer'Image(). I modified the loop,
and now it look more like the C version, relying on the I/O library
(using Ada.Integer_Text_IO).
Amazingly, now it compiles in about 2 seconds. Summarizing, these are
the data (below are the fragments of the codes used):

                      GNU/C      GNU/Ada (1)      GNU/Ada (2)    
GNU/Ada (3)
Source size (kB)       45           82              103             
97
Object size (kB)       63          503              503            
109

time to compile (s)   1.4         11.0              8.0            
2.2

compiled with gcc -c file.adb (no switches)

In conclusion... draw your own conclusion. 

Memo for me: next time don't spare resources, use at lest 2 neurons
:-)

The codes for the loops (repeated 1000 times) were:

GNU/C
for (i=0; i<100; ++i)
  printf("%d\n",i);

GNU/Ada (1)
for i in 1..100 loop
  ada.text_io.put_line( Integer'Image(i) );
end loop;

GNU/Ada (2)
i := 0;
while i<100 loop
  ada.text_io.put_line( Integer'Image(i) );
end loop;

GNU/Ada (3)
for i in 1..100 loop
  ada.integer_text_io.put( i );
  ada.text_io.new_line;
end loop;



  parent reply	other threads:[~2002-03-01 23:17 UTC|newest]

Thread overview: 52+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <3C74E519.3F5349C4@baesystems.com>
     [not found] ` <20020221205157.05542.00000012@mb-cm.news.cs.com>
2002-02-22 12:19   ` naval systems David Gillon
2002-02-22 14:55     ` Marin David Condic
2002-02-23  5:54       ` David Starner
2002-02-25 15:05         ` Marin David Condic
2002-02-26  2:34           ` Larry Kilgallen
2002-02-26 17:44           ` David Starner
2002-02-26 19:49             ` Pat Rogers
2002-02-26 19:55               ` Ray Blaak
2002-02-26 20:46                 ` Pat Rogers
2002-02-26 22:41                   ` Ray Blaak
2002-02-27  0:02                     ` Pat Rogers
2002-02-27  5:01                       ` David Starner
2002-02-27  9:38                         ` Jean-Pierre Rosen
2002-02-27 19:48                         ` compiler benchmark comparisons (was: naval systems) Wes Groleau
2002-02-27 21:51                           ` Pat Rogers
2002-03-01  2:04                             ` David Starner
2002-03-01  4:06                               ` Pat Rogers
2002-02-27 23:53                           ` Gary Barnes
2002-02-28  2:19                             ` Dan Andreatta
2002-02-28 10:04                               ` Jerry van Dijk
2002-02-28 13:35                               ` compiler benchmark comparisons Georg Bauhaus
2002-02-28 18:12                                 ` Dan Andreatta
2002-03-01  5:07                                   ` Robert Dewar
2002-03-01 16:43                                     ` Dan Andreatta
2002-03-01 23:17                                     ` Dan Andreatta [this message]
2002-03-01 23:40                                       ` tmoran
2002-02-28 14:18                               ` compiler benchmark comparisons (was: naval systems) Wes Groleau
2002-02-28 14:31                               ` Ted Dennison
2002-02-28 18:33                                 ` Dan Andreatta
2002-02-28 21:14                                 ` Wes Groleau
2002-02-28 14:01                             ` Wes Groleau
2002-03-01 22:01                               ` Randy Brukardt
2002-02-28 15:58                             ` Larry Kilgallen
     [not found]                             ` <338040f8.0202271819.373f733a@Organization: LJK Software <TgAW8WWqYgP5@eisner.encompasserve.org>
2002-03-01 19:29                               ` Robert Dewar
2002-03-02 11:12                                 ` Pascal Obry
2002-03-02 19:49                                   ` Richard Riehle
     [not found]                               ` <5ee5b646.0203011129.1bdbac56@po <ug03ji5ow.fsf@wanadoo.fr>
2002-03-02 18:20                                 ` Simon Wright
2002-02-27  2:28                   ` naval systems David Starner
2002-02-27 21:44                     ` Pat Rogers
2002-03-01  2:59                       ` David Starner
2002-03-01 15:33                         ` Pat Rogers
2002-03-01 17:22                       ` Jeffrey Carter
2002-03-03  5:21                         ` David Starner
2002-02-26 22:40                 ` Pascal Obry
2002-02-27  0:42               ` David Starner
2002-02-23 19:18       ` John R. Strohm
2002-02-23 18:36         ` martin.m.dowie
2002-02-25 15:10         ` Marin David Condic
2002-02-28 16:33     ` tony gair
2002-02-28 17:33       ` David Gillon
2002-02-28 21:18       ` Wes Groleau
2002-03-01 17:31       ` Boeing 777 (WAS: naval systems) Simon Pilgrim
replies disabled

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