[GAP Forum] Speed of GAP
Bulutoglu Dursun A Civ AFIT/ENC
Dursun.Bulutoglu at afit.edu
Fri Feb 18 19:21:21 GMT 2005
My experience is that MATLAB is slower than C by a factor of 2
or 3. Also R, (a statistical language) is 10 times slower than C. In
general higher level languages (languages that have a lot of overhead)
are slower than lower level languages like C or Fortran. My question was
how GAP compares to C in terms of speed. I am assuming that GAP is a
higher level language as one does not have to define everything like in
C.
Also programming style can make a difference in higher level languages.
In R it is recommended that the user should avoid for loops as much as
possible as for loops in R become intangible when they are large.
Dursun.
> Dear Gap Forum,
> I was wondering how GAP compares to C in terms of speed.
> Is GAP slower processing through large loops?
> Is there a programming style in GAP that can improve the speed at
which
> jobs are done? For example in some high level programming languages
> avoiding loops as much as possible is recommended to boost speed.
> Is GAP much slower when the data it processes through is large?
> I have a GAP code running for a week now and it still has not
finished.
> I have a feeling that it would have run much faster with C.
> Dursun.
I don't know about your particular situation, but usually when such
problems arise, they simply cannot be solved by changing the programming
language. If you're lucky you could slice the running time of your
program
by a constant factor. Your description reveals that either your problem
is
essentially intractable or you must look for a better algorithm. A
personal anecdote: I had a GAP program that computed the number of
elements of a finitely presented monoids in several hours; after careful
considerations I found a better algorithm that could do the same work in
milliseconds. Good luck,
Hebert.
> _______________________________________________
> Forum mailing list
> Forum at mail.gap-system.org
> http://mail.gap-system.org/mailman/listinfo/forum
More information about the Forum
mailing list