#11900: Serious regression caused by #9138
------------------------------+---------------------------------------------
   Reporter:  SimonKing       |          Owner:  tbd                  
       Type:  defect          |         Status:  needs_work           
   Priority:  critical        |      Milestone:  sage-4.8             
  Component:  performance     |       Keywords:  categories regression
Work_issues:                  |       Upstream:  N/A                  
   Reviewer:  Jeroen Demeyer  |         Author:  Simon King           
     Merged:                  |   Dependencies:  #9138 #11911         
------------------------------+---------------------------------------------

Comment(by SimonKing):

 You write that the Category_singleton uses an optimized class call. It is
 indeed slightly faster than the usual classcall, as it seems:
 {{{
 sage: from sage.categories.category_singleton import Category_singleton
 sage: class MyRingsSingleton(Category_singleton):
 ....:     super_categories = Rings.__dict__['super_categories']
 ....:
 sage: MR = MyRingsSingleton()
 sage: MR
 Category of my rings singleton
 sage: %timeit MyRingsSingleton()
 625 loops, best of 3: 5.28 µs per loop
 sage: %timeit Rings()
 625 loops, best of 3: 6.92 µs per loop
 sage: %timeit MyRingsSingleton()
 625 loops, best of 3: 3.39 µs per loop
 sage: %timeit Rings()
 625 loops, best of 3: 6.92 µs per loop
 sage: %timeit MyRingsSingleton()
 625 loops, best of 3: 3.38 µs per loop
 sage: %timeit Rings()
 625 loops, best of 3: 7.02 µs per loop
 }}}

 I don't know why the first "timeit" for `MyRingsSingleton` is so match
 slower than the other two runs.

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