#12808: Optimize ClassCallMetaClass using Cython
--------------------------------------------------+-------------------------
Reporter: hivert | Owner: jason
Type: enhancement | Status:
needs_review
Priority: major | Milestone: sage-5.1
Component: misc | Resolution:
Keywords: classcall UniqueRepresentation | Work issues:
Report Upstream: N/A | Reviewers: Simon King,
Florent Hivert
Authors: Florent Hivert, Simon King | Merged in:
Dependencies: | Stopgaps:
--------------------------------------------------+-------------------------
Changes (by hivert):
* status: needs_info => needs_review
Old description:
> When a class {{{C}}} is an instance of {{{ClasscallMetaclass}}}, then for
> any constructor call, the system currently looks for {{{__classcall__}}}
> and {{{__classcall_private__}}} in {{{C}}}. This adds quite an overhead
> and this could be cached, assuming no one modifies {{{C}}} (which seems
> reasonable). Improving this speeds up, in particular, all call to the
> constructor of a subclass of {{{UniqueRepresentation}}}, eg. many
> parents, all categories...
>
> __Apply__
>
> * [attachment:trac_12808-classcall_speedup-fh.patch]
> * [attachment:trac_12808_nested_class_cython.patch]
>
> and we have to decide whether the third patch helps to make the code
> clearer:
>
> * [attachment:trac_12808-classcall_cdef.patch]
New description:
When a class {{{C}}} is an instance of {{{ClasscallMetaclass}}}, then for
any constructor call, the system currently looks for {{{__classcall__}}}
and {{{__classcall_private__}}} in {{{C}}}. This adds quite an overhead
and this could be cached, assuming no one modifies {{{C}}} (which seems
reasonable). Improving this speeds up, in particular, all call to the
constructor of a subclass of {{{UniqueRepresentation}}}, eg. many parents,
all categories...
__Apply__
* [attachment:trac_12808-classcall_speedup-fh.patch]
* [attachment:trac_12808_nested_class_cython.patch]
* [attachment:trac_12808-classcall_cdef.patch]
--
Comment:
Replying to [comment:52 jdemeyer]:
> Please decide which patches have to be applied.
Sorry ! I forgot to remove Simon's question. It's decided.
Florent
--
Ticket URL: <http://trac.sagemath.org/sage_trac/ticket/12808#comment:53>
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.