[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Axiom-developer] Re: [Axiom-mail] A slow summation
From: |
Bill Page |
Subject: |
[Axiom-developer] Re: [Axiom-mail] A slow summation |
Date: |
Fri, 15 Jun 2007 02:40:47 -0400 |
On 15 Jun 2007 07:49:11 +0200, Martin Rubey wrote:
> > reduce(+,[1.0/i for i in 1..20000])
> >
> > This works, but is (I think) unreasonably slow; it takes over 21 seconds on
> > my computer. The equivalent command in Maxima takes less than 1 second.
Bill, could you file that as a bug on MathAction, please.
Well, I would rather that somebody new do that. Alasdair? :-)
The "issue" (I am not quite sure to call it a "bug") is probably some
very inefficient implementation of list comprehension in the Axiom
interpreter. E.g.
(1) -> )set message time on
(1) -> [i for i in 1..20000];
Type: List PositiveInteger
Time: 14.73 (EV) + 0.02 (OT) + 0.05 (GC) = 14.80 sec
(2) -> expand(1..20000);
Type: List Integer
Time: 0.07 (IN) + 0.18 (OT) = 0.25 sec
-------
Both (1) and (2) do essentially the same thing.
(If you have an sbcl compiled axiom available, you could check
whether it is gcl's fault, or rather a bug in axiom.)
I am quite sure that this is not a lisp implementation issue,
but no I don't have a sbcl version of Axiom available. Do you?
Still, maybe this is a job for someone who knows how to use
the sbcl profiler to find out where the Axiom interpreter is
spending all it's time - Waldek?
Regards,
Bill Page.