#12808: Optimize ClassCallMetaClass using Cython
--------------------------------------------------+-------------------------
       Reporter:  hivert                          |         Owner:  jason       
           Type:  enhancement                     |        Status:  needs_review
       Priority:  major                           |     Milestone:  sage-5.0    
      Component:  misc                            |    Resolution:              
       Keywords:  classcall UniqueRepresentation  |   Work issues:              
Report Upstream:  N/A                             |     Reviewers:              
        Authors:  Florent Hivert                  |     Merged in:              
   Dependencies:                                  |      Stopgaps:              
--------------------------------------------------+-------------------------

Comment (by hivert):

 Hi Simon,

 Thanks for your in depth review.

 Replying to [comment:20 SimonKing]:
 > Some further questions (in addition to my question about the rĂ´le of
 _included_private_doc_):

 This is a tentative inclusion of the doc of the special methods (see
 [http://groups.google.com/group/sage-
 devel/browse_thread/thread/b1cf6b2243bba673?hl=en this thread] on sage
 devel.

 > Why is `__all__ = ['ClasscallType', 'ClasscallMetaclass', 'typecall',
 'timeCall']` added? Isn't importing also possible without that? Or is it
 needed to make `from sage.misc.classcall_metaclass import *` work?

 I just want to hide the few class I wrote here for timing (CRef, C2, C3,
 C2C). With this line, they are neither imported with import *, nor
 documented.

 > Why is there a two-step cythonisation? I mean, why is there a cdef class
 > `ClasscallType` implementing the special methods, and then
 > `ClasscallMetaclass` defined by double inheritance from `ClasscallType`
 and
 > `NestedClassMetaclass`? Wouldn't it be better/easier/faster to cdef
 > `NestedClassMetaclass` as well, and then cdef `ClasscallMetaclass`
 directly,
 > without having the `ClasscallType`?

 There is this discussion about cleaning up the way metaclass are defined
 and
 used in Sage. I just wanted to keep features separate. Should we decide to
 merge or rewrite the metaclass architecture, I'd rather to keep this for a
 different ticket.

 > I guess the typecall function will be useful in other modules (e.g.,
 when
 > cythonising dynamic_class). But it only is def. Shouldn't it rather be
 `cdef
 > inline`?

 You mean `cpdef inline` (we may want to call it from Python) ? I had the
 impression from C that this inline doesn't do anything if the function is
 defined in a different module. More precisely, in C/C++ inline only work
 if
 the function is defined in {{{.h}}} instead of {{{.c}}}. Does Cython do
 anything for that ?

 > Concerning the timing tools provided in the module: Is there still no
 > "central" location for all aspects of timing? I thought there were
 > occasional discussions on sage-devel about a benchmark/timing framework.

 Not that I know of.

 Florent

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