comp.lang.ada
 help / color / mirror / Atom feed
From: hugin777@my-deja.com
Subject: Re: Announcing JGNAT public version 1.0p
Date: 2000/04/10
Date: 2000-04-10T00:00:00+00:00	[thread overview]
Message-ID: <8ct83j$ho3$1@nnrp1.deja.com> (raw)
In-Reply-To: 8cs4ad$ft3$1@clnews.edf.fr

In article <8cs4ad$ft3$1@clnews.edf.fr>,
  "Pascal Obry" <p.obry@der.edf.fr> wrote:
> Ok, now I see the problem. You did not code the same algorithm :)
>
> Look at markMultiplum in Java you have added a first test isPrime[i]
and
> this is not coded in Ada, most certainly this would reduce Ada time :)
> >             if (isPrime[i] && i % divisor == 0) isPrime[i] = false;
> >             if i mod Divisor = 0 then Is_Prime (i) := false; end if;
> Do you mind to try with
>          for i in Divisor+1 .. Is_Prime'Last loop
>              if Is_Prime (i) and then i mod Divisor = 0 then
>                  Is_Prime (i) := false;
>              end if;
>          end loop;
>
> And anyway this algorithm is very far from being efficient...


Thanks a lot !

As you can imaging I feel a bit stupid. But what worries me even more is
that the Java version still is consistently faster (but not so much any
more) even with the same algorithm (even tried with various combinations
of -O2, -O3, -gnatp, Component_Size=1,8,32 &c) !!
  If Robert Dewar is right and it isn't caused by Pentium optimizations
then IBM truly does magic ! How can it be faster when it has to be
profiled, JIT'ed and _then_ run at full speed ?

Amazing... Or maybe I have overlooked something else.

I think I will go back to just lurking for a while :-)

Keep up the good work !


PS: I do not really _want_ to calculate primes :-) I just wanted to see
how it looked like in ML, Ada and Java. But when I ran it I got a
surprise !!

PPS: I have just begun studying CS in Denmark (DIKU, Copenhagen), where
they apparently love ML. I haven't met others interested in Ada yet.
They all seem to prefer the short'n'fast way of ML; sadly. Maybe there's
no hope for them... ;-)

PPPS: Please educate me as to where I would find a better algorithm!


Regards,
   Jens Jakob Jensen.


Sent via Deja.com http://www.deja.com/
Before you buy.




  reply	other threads:[~2000-04-10  0:00 UTC|newest]

Thread overview: 38+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2000-03-28  0:00 Announcing JGNAT Professional version 1.0a Robert Dewar
2000-03-31  0:00 ` Announcing JGNAT public version 1.0p Robert Dewar
2000-04-01  0:00   ` John Merryweather Cooper
2000-04-02  0:00     ` Robert Dewar
2000-04-02  0:00       ` John Merryweather Cooper
2000-04-03  0:00         ` Robert Dewar
2000-04-02  0:00           ` John Merryweather Cooper
2000-04-03  0:00             ` Robert Dewar
2000-04-04  0:00               ` JGNAT help puh-leeze G
2000-04-04  0:00                 ` Geoff Bull
2000-04-06  0:00                   ` G
2000-04-06  0:00                     ` Geoff Bull
2000-04-04  0:00               ` Announcing JGNAT public version 1.0p Charles Hixson
2000-04-05  0:00                 ` Geoff Bull
2000-04-05  0:00                 ` David Botton
2000-04-06  0:00                   ` Charles Hixson
2000-04-07  0:00                     ` Geoff Bull
2000-04-07  0:00                     ` hugin777
2000-04-07  0:00                       ` Robert Dewar
2000-04-07  0:00                         ` Ted Dennison
2000-04-08  0:00                           ` Geoff Bull
2000-04-08  0:00                         ` Geoff Bull
2000-04-08  0:00                         ` hugin777
2000-04-09  0:00                           ` Optimizing flags Was: " Ken O. Burtch
2000-04-07  0:00                       ` Pascal Obry
2000-04-08  0:00                       ` Geoff Bull
2000-04-10  0:00                       ` Pascal Obry
2000-04-10  0:00                         ` hugin777 [this message]
2000-04-10  0:00                           ` Al Christians
2000-04-10  0:00                           ` David Starner
2000-04-11  0:00                             ` Brian Rogoff
2000-04-11  0:00                               ` Tucker Taft
2000-04-11  0:00                                 ` Brian Rogoff
2000-04-11  0:00                               ` David Starner
2000-04-11  0:00                           ` Pascal Obry
2000-04-12  0:00                           ` Pascal Obry
2000-04-03  0:00             ` Robert Dewar
2000-04-04  0:00           ` ada_95
replies disabled

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