Subject: Better implementation of random_permutation
From: Mark H Weaver
Date: Thu, 20 Jan 2011 16:36:06 -0500
I wrote:
> On my system (Maxima 5.23.2 on GCL 2.6.7 on a Loongson processor),
> this version runs about 46 times faster on a list of length 1000.
Furthermore, it runs about 27 times faster on a list of length 100,
and about 8.7 times faster on a list of length 10.
Note that these timings are based on the total computation time (as
measured by showtime:true) when calling random_permutation many times on
the same list as follows:
showtime:true$
lst: makelist(random(10),n,1,10)$
for i:1 thru 10000 do random_permutation(lst)$
lst: makelist(random(100),n,1,10)$
for i:1 thru 1000 do random_permutation(lst)$
lst: makelist(random(1000),n,1,10)$
for i:1 thru 100 do random_permutation(lst)$
> Any objections to me committing this change to the trunk?
Mark