#19810: Optimize get_key() for cached functions
-------------------------------------+-------------------------------------
Reporter: jdemeyer | Owner:
Type: enhancement | Status: needs_review
Priority: major | Milestone: sage-7.0
Component: misc | Resolution:
Keywords: | Merged in:
Authors: Jeroen Demeyer | Reviewers:
Report Upstream: N/A | Work issues:
Branch: | Commit:
u/jdemeyer/ticket/19810 | 5935e74937021979c229e009f6b9ee64f1ec70c0
Dependencies: | Stopgaps:
-------------------------------------+-------------------------------------
Comment (by nbruin):
Do we have figures on what kind of optimization gain is obtained by these
changes? Or are we just getting the benefit of having more streamlined and
hence more maintainable code?
I noticed this one:
{{{
- new = lambda x: not has_key(get_key(*x[0],**x[1]))
+ new = lambda x: not has_key(self.get_key(*x[0],**x[1]))
arglist = filter(new, map(normalize_input, arglist))
}}}
Writing that as a list comprehension should avoid an extra (expensive)
python call, so should be a little faster.
--
Ticket URL: <http://trac.sagemath.org/ticket/19810#comment:8>
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 https://groups.google.com/group/sage-trac.
For more options, visit https://groups.google.com/d/optout.