#8746: Equality of posets element is very slow
------------------------------+---------------------------------------------
   Reporter:  hivert          |       Owner:  sage-combinat             
       Type:  defect          |      Status:  new                       
   Priority:  major           |   Milestone:  sage-4.4                  
  Component:  combinatorics   |    Keywords:  Comparison posets elements
     Author:  Florent Hivert  |    Upstream:  N/A                       
   Reviewer:                  |      Merged:                            
Work_issues:                  |  
------------------------------+---------------------------------------------
 This is due to comparing the parent which can indeed be very slow. However
 most of the time when comparing {{{x}}} and {{{y}}}, the two parent are
 identical and are better compared with {{{is}}}. Here is the results:

 Before the patch:

 {{{
 sage: P = Posets.ChainPoset(30)
 sage: %time len([x == y for x in P for y in P])
 CPU times: user 18.05 s, sys: 0.04 s, total: 18.09 s
 Wall time: 18.25 s
 900
 }}}
 After the patch:
 {{{
 sage: P = Posets.ChainPoset(30)
 sage: %time len([x == y for x in P for y in P])
 CPU times: user 0.03 s, sys: 0.00 s, total: 0.03 s
 Wall time: 0.02 s
 900
 }}}

 Cheers,

 Florent

-- 
Ticket URL: <http://trac.sagemath.org/sage_trac/ticket/8746>
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 post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/sage-trac?hl=en.

Reply via email to