#13589: Controlling C3 to solve once for all the Method Resolution Order issues
for
category classes
----------------------------------------------------------+-----------------
Reporter: nthiery | Owner:
nthiery
Type: defect | Status:
needs_review
Priority: major | Milestone:
sage-5.11
Component: categories | Resolution:
Keywords: method resolution order, C3 | Work issues: Add
tests in c3_controlled
Report Upstream: N/A | Reviewers:
Simon King, Florent Hivert
Authors: Nicolas M. ThiƩry, Simon King | Merged in:
Dependencies: #12894, #12876, #11935, #12895, #10193 | Stopgaps:
----------------------------------------------------------+-----------------
Comment (by SimonKing):
Concerning a small function I added:
{{{
sage: from operator import attrgetter
sage: f = attrgetter("_cmp_key")
sage: C = Rings()
sage: %timeit a = f(C)
1000000 loops, best of 3: 439 ns per loop
sage: from sage.misc.c3_controlled import category_sort_key
sage: %timeit a = category_sort_key(C)
10000000 loops, best of 3: 154 ns per loop
}}}
That's why I added it (and: It is cpdef inline, hence, if Cython is
clever, the speed difference with attrgetter will be even better).
--
Ticket URL: <http://trac.sagemath.org/sage_trac/ticket/13589#comment:64>
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 unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/sage-trac.
For more options, visit https://groups.google.com/groups/opt_out.