#11559: Speed up Posets and toric Chow group
-------------------------------------+-------------------------------------
       Reporter:  vbraun             |         Owner:
           Type:  enhancement        |        Status:  needs_review
       Priority:  major              |     Milestone:  sage-5.11
      Component:  algebraic          |    Resolution:
  geometry                           |     Merged in:
       Keywords:  toric, sd40.5      |     Reviewers:  Andrey Novoseltsev
        Authors:  Volker Braun       |   Work issues:
Report Upstream:  N/A                |  Dependencies:  #11558, #10998,
         Branch:                     |  #13023
       Stopgaps:                     |
-------------------------------------+-------------------------------------

Old description:

> To my surprise, computing the Chow group spends most of the time
> comparing cones instead of doing linear algebra. 3/4 of the time is spent
> in `PosetElement.__eq__()`:
> {{{
>    return self.parent() == other.parent() \
>           and self.element == other.element \
>           and self.vertex == other.vertex
> }}}
> Reordering this to first compare `self.vertex == other.vertex` speeds it
> up dramatically.
>
> Patch has some other fixes. Changes the chow group to use sparse
> matrices.

New description:

 To my surprise, computing the Chow group spends most of the time comparing
 cones instead of doing linear algebra. 3/4 of the time is spent in
 `PosetElement.__eq__()`:
 {{{
    return self.parent() == other.parent() \
           and self.element == other.element \
           and self.vertex == other.vertex
 }}}
 Reordering this to first compare `self.vertex == other.vertex` speeds it
 up dramatically.

 Patch has some other fixes. Changes the chow group to use sparse matrices.

 Apply:

 - [attachment:trac_11559_fix_Chow_group.2.patch]
 - [attachment:trac_11559_hasattr_vertex_fc.patch]

--

Comment (by chapoton):

 for the bot:

 apply trac_11559_fix_Chow_group.2.patch trac_11559_hasattr_vertex_fc.patch

 If you do not want to check the parent first, you need to make sure that
 other has the attribute "vertex" !

 This ticket needs benchmarking, to see if something significant is still
 gained in term of time or not.

--
Ticket URL: <http://trac.sagemath.org/ticket/11559#comment:16>
Sage <http://www.sagemath.org>
Sage: Creating a Viable Open Source Alternative to Magma, Maple, Mathematica, 
and MATLAB

-- 
You received this message because you are subscribed to the Google Groups 
"sage-trac" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/sage-trac.
For more options, visit https://groups.google.com/groups/opt_out.


Reply via email to