#15303: Coercion discovery fails to be transitive
-------------------------------------+-------------------------------------
       Reporter:  nbruin             |        Owner:
           Type:  defect             |       Status:  needs_work
       Priority:  major              |    Milestone:  sage-5.13
      Component:  coercion           |   Resolution:
       Keywords:                     |    Merged in:
        Authors:  Simon King         |    Reviewers:
Report Upstream:  N/A                |  Work issues:  Crash in permgroup.py
         Branch:                     |       Commit:
  u/SimonKing/ticket/15303           |  807550bbc45e9872ac365fc98b817ccd5bcfbb95
   Dependencies:  #14711, #15329,    |     Stopgaps:
  #15331                             |
-------------------------------------+-------------------------------------

Comment (by SimonKing):

 With
 {{{
 #!python
 def test_set2(list L):
     global testset
     testset = set([])
     for X in L:
         for Y in L:
             testset.add((<Py_ssize_t><void *>X, <Py_ssize_t><void
 *>Y,"test"))
             (<Py_ssize_t><void *>X, <Py_ssize_t><void *>Y,"test") in
 testset
             (<Py_ssize_t><void *>X, <Py_ssize_t><void *>Y,"fail") in
 testset
     for X in L:
         for Y in L:
             try:
                 testset.remove((<Py_ssize_t><void *>X, <Py_ssize_t><void
 *>Y,"test"))
             except KeyError:
                 pass
 }}}
 I get a further speed-up:
 {{{
 sage: %time test_set2(L)
 CPU times: user 3.18 s, sys: 0.00 s, total: 3.18 s
 Wall time: 3.19 s
 }}}

 So, the speed-up we can get for marking/unmarking/testing of arrows in the
 coerce digraph during backtracking is a factor of about 4.5.

--
Ticket URL: <http://trac.sagemath.org/ticket/15303#comment:88>
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