#13501: Fix two bugs in sage.misc.c3's implementation of the algorithm C3
-------------------------------------------+--------------------------------
       Reporter:  nthiery                  |         Owner:  nthiery     
           Type:  defect                   |        Status:  needs_review
       Priority:  major                    |     Milestone:  sage-5.4    
      Component:  categories               |    Resolution:              
       Keywords:  method resolution order  |   Work issues:              
Report Upstream:  N/A                      |     Reviewers:  Simon King  
        Authors:  Nicolas M. ThiƩry        |     Merged in:              
   Dependencies:  #12895                   |      Stopgaps:              
-------------------------------------------+--------------------------------

Comment (by SimonKing):

 For the record: With sage-5.4.beta0 and
 {{{
 trac_715_combined.patch
 trac_715_local_refcache.patch
 trac_715_safer.patch
 trac_715_specification.patch
 trac_11521_homset_weakcache_combined.patch
 trac_11521_callback.patch
 13145.patch
 trac_13447-sanitise_ring_refcount.patch
 trac12215_weak_cached_function-sk.patch
 trac12215_segfault_fixes.patch
 trac_12313-mono_dict-combined-random-sk.patch
 trac_12313_quit_sage.patch
 trac13370_deprecate_is_field.patch
 trac_13378-convert_map_shortcut.patch
 trac_13412_category_for_power_series_rings.patch
 }}}
 and with `%prun f(500)` (because 200 may not be enough), I get
 {{{
    ncalls  tottime  percall  cumtime  percall filename:lineno(function)
  7000/500    0.212    0.000    0.773    0.002 {sage.misc.c3.C3_algorithm}
 }}}

 Adding your main patch, I get
 {{{
    ncalls  tottime  percall  cumtime  percall filename:lineno(function)
  7000/500    0.307    0.000    0.848    0.002 {sage.misc.c3.C3_algorithm}
 }}}

 And with the optimization patch, I get
 {{{
    ncalls  tottime  percall  cumtime  percall filename:lineno(function)
  7000/500    0.304    0.000    0.853    0.002 {sage.misc.c3.C3_algorithm}
 }}}

 So, the slow-down is little and using the C Api is not noticeable.

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