[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Gcl-devel] [Maxima] use_fast_arrays is slow in GCL for hash tables
From: |
Camm Maguire |
Subject: |
Re: [Gcl-devel] [Maxima] use_fast_arrays is slow in GCL for hash tables |
Date: |
Thu, 05 Jul 2012 14:05:24 -0400 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/23.2 (gnu/linux) |
Greetings, and thanks for pointing this out!
As you might suspect, this is a weakness in the hash function algorithm
for this set of keys, which is currently generating too many collisions.
I've committed a fix into the stable and experimental branches which you
might like to look at. Am also updating the appropriate Debian
packages.
Take care,
Barton Willis <address@hidden> writes:
> Assign and access a 40,000 member hashtable
>
> GCL: 100.6400 seconds
> CCL: 0.7800 seconds
>
> This has been pointed out before, I think. The code:
>
> (%i1) showtime : true$
> Evaluation took 0.0000 seconds (0.0000 elapsed)
> (%i2) block([use_fast_arrays : true, n : 200],
> (for i : 1 thru n do for j : 1 thru n do a[i,j] : i+j,
> s : 0,
> for i : 1 thru n do for j : 1 thru n do s : s + a[i,j]));
> Evaluation took 100.6400 seconds (100.6400 elapsed)
> (%o2) done
>
> (%i3) s;
> Evaluation took 0.0000 seconds (0.0000 elapsed)
> (%o3) 8040000
> (%i4) block([use_fast_arrays : false, n : 200],
> (for i : 1 thru n do for j : 1 thru n do b[i,j] : i+j,
> s : 0,
> for i : 1 thru n do for j : 1 thru n do s : s + b[i,j]));
> Evaluation took 0.7700 seconds (0.7700 elapsed)
> (%o4) done
> (%i5) s;
> Evaluation took 0.0000 seconds (0.0000 elapsed)
> (%o5) 8040000
>
>
> With CCL:
>
> (%i1) showtime : true$
> Evaluation took 0.0000 seconds (0.0000 elapsed)
> (%i2) block([use_fast_arrays : true, n : 200],
> (for i : 1 thru n do for j : 1 thru n do a[i,j] : i+j,
> s : 0,
> for i : 1 thru n do for j : 1 thru n do s : s + a[i,j]));
> Evaluation took 0.7800 seconds (0.7800 elapsed)
> (%o2) done
> (%i3) s;
> Evaluation took 0.0000 seconds (0.0000 elapsed)
> (%o3) 8040000
> (%i4) block([use_fast_arrays : false, n : 200],
> (for i : 1 thru n do for j : 1 thru n do b[i,j] : i+j,
> s : 0,
> for i : 1 thru n do for j : 1 thru n do s : s + b[i,j]));
> Evaluation took 0.8892 seconds (0.8900 elapsed)
> (%o4) done
> (%i5) s;
> Evaluation took 0.0000 seconds (0.0000 elapsed)
> (%o5) 8040000
> (%i6)
>
>
>
>
> --Barton
>
> _______________________________________________
> Maxima mailing list
> address@hidden
> http://www.math.utexas.edu/mailman/listinfo/maxima
>
>
>
>
--
Camm Maguire address@hidden
==========================================================================
"The earth is but one country, and mankind its citizens." -- Baha'u'llah
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- Re: [Gcl-devel] [Maxima] use_fast_arrays is slow in GCL for hash tables,
Camm Maguire <=