axiom-developer
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

RE: [Axiom-developer] Why is Axiom so slow?


From: Page, Bill
Subject: RE: [Axiom-developer] Why is Axiom so slow?
Date: Wed, 5 Jul 2006 17:24:49 -0400

William,

On Wednesday, July 05, 2006 4:28 AM you wrote:
> 
> Wow, you are good with Axiom! (and everything else, of course).
>

Well, thank you! <bows> ;-)
 
> > An array data structure can be accessed much more rapidly.
> > Try something like this instead:
> >
> > (1) -> l1:=new(10000,0)$ARRAY1(INT); _
> >        map!(x+->random(100)+random(100),l1);
> >
> >           Type: OneDimensionalArray Integer
> >     Time: 0.20 (EV) + 0.08 (GC) = 0.28 sec
> >
> 
> Axiom can even do 100000 in about 1.35 secs. Still about 7 
> times as long as the best try in Mathematica.
> 
> In[85]:=
> Timing[Table[Random[Integer,100]+Random[Integer,100],{i,1,1000
> 00}]][[1]]
> 
> Out[85]=
> 0.203 Second
> 

It seems that Axiom can perform about the same as Mathematica
if we are careful to compile the initialization function before
calling it.

See http://wiki.axiom-developer.org/SandBoxArray

  init1(x:Integer):Integer == random(100)-random(100)
  l1:PRIMARR(INT):=new(100000,0); map!(init1,l1);

This only takes about 0.15 seconds on the AxiomWiki server.

This also shows that overhead for using map! is not very
high (almost not measurable) provided the function is
compiled.

Regards,
Bill Page.




reply via email to

[Prev in Thread] Current Thread [Next in Thread]