On Thu, Aug 23, 2012 at 05:43:27PM +0200, Nicolas M. Thiery wrote:
> As for the room for improvement, for Weyl character rings, but also
> for everything using root systems intensively, like Weyl groups and
> the like, a big spot is the optimization of CombinatorialFreeModule in
> small dimension by using a dense representation.

As a first step, see http://trac.sagemath.org/sage_trac/ticket/13406:

Converting a CombinatorialFreeModule element to a vector (e.g. dense
FreeModule element) was ridiculously slow:

Before:

sage: sage: F = CombinatorialFreeModule(QQ, range(10))
sage: f = F.an_element()
sage: %timeit f._vector_()
625 loops, best of 3: 142 µs per loop
sage: %timeit f.to_vector()
625 loops, best of 3: 143 µs per loop
sage: %timeit vector(f)
625 loops, best of 3: 159 µs per loop

After:

sage: F = CombinatorialFreeModule(QQ, range(10))
sage: f = F.an_element()
sage: %timeit f._vector_()
625 loops, best of 3: 18.4 µs per loop
sage: %timeit f.to_vector()
625 loops, best of 3: 18.5 µs per loop
sage: %timeit vector(f)
625 loops, best of 3: 34.6 µs per loop

This impacts for example Weyl group actions, and thus lots of the root
systems arithmetic.

Before:

sage: W = WeylGroup(["A",5])
sage: %time l = list(W)
CPU times: user 3.55 s, sys: 0.00 s, total: 3.55 s
Wall time: 3.57 s

After:

sage: W = WeylGroup(["A",5])
sage: %time l = list(W)
CPU times: user 2.80 s, sys: 0.00 s, total: 2.81 s
Wall time: 2.81 s

Please review!

Cheers,
                                Nicolas
--
Nicolas M. Thiéry "Isil" <nthi...@users.sf.net>
http://Nicolas.Thiery.name/

-- 
You received this message because you are subscribed to the Google Groups 
"sage-combinat-devel" group.
To post to this group, send email to sage-combinat-devel@googlegroups.com.
To unsubscribe from this group, send email to 
sage-combinat-devel+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/sage-combinat-devel?hl=en.

Reply via email to