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: Tue, 4 Jul 2006 23:46:54 -0400

Martin,

On Tuesday, July 04, 2006 5:35 PM you wrote:
> 
> I am just submitting my article about guessing formulas. One 
> important aspect of this article is that I am - contrary to
> the other packages - using fast algorithms.
> 
> So, I wanted to do a speed comparison. I must say, I am 
> shocked. Even though I used certainly the best algorithms
> available, they are still *much* slower than the naïve
> versions in Mathematica or Maple.

I have to admit that Maple (and Mathematica?) is faster than
Axiom for some things. For example my Maple version of

http://wiki.axiom-developer.org/SandBoxCategoricalRelativity

is at least 10 times faster than the Axiom version above. In
this case I think it has something to do with the implementation
of the AlgebraicNumber domain.

But in your case I do not think you are comparing equivalent
computations.

> 
> I just did another test:
> 
> In[2]:= Timing[Table[Random[Integer, 100]+Random[Integer, 
> 100], {i,1,10000}]][[1]]
> 
> Out[2]= 0.1 Second
> 
> In[3]:= Timing[Table[Random[Integer, 100]+Random[Integer, 
> 100], {i,1,100000}]][[1]]
> 
> Out[3]= 1.01 Second
>

As a data structure 'Table' in Mathematica is not the same as
'List' in Axiom.

> (1) -> )se me au of
> (1) -> )time on
> (1) -> l1 := [random(100) for i in 1..10000];
>        l2 := [random(100) for i in 1..10000];
>
>        Type: List Integer
>    Time: 0.01 (IN) + 14.66 (EV) + 0.25 (GC) = 14.92 sec
>...
> Any suggestions?

I think it takes Axiom a long time to build a list this large.
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

Regards,
Bill Page.




reply via email to

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