#15038: Improve startuptime by postponing the creation of argspecs of cached
functions/methods
-------------------------+-------------------------------------------------
    Reporter:            |            Owner:
  SimonKing              |           Status:  new
        Type:            |        Milestone:  sage-5.12
  enhancement            |         Keywords:  cached method, argspec,
    Priority:  major     |  introspection, startup
   Component:            |          Authors:  Simon King
  performance            |  Report Upstream:  N/A
   Merged in:            |           Branch:
   Reviewers:            |         Stopgaps:
 Work issues:            |
Dependencies:            |
-------------------------+-------------------------------------------------
 Currently, if a cached method or function is created, an instance of
 `sage.misc.function_mangling.ArgumentFixer` is created as well. But this
 is only needed when the cached function/method is actually called.

 With this patch, the `ArgumentFixer` is either created when it is needed
 to normalise arguments (i.e., when the function is called), or when a
 `CachedMethodCaller` is bound to an instance. The latter is because
 different `CachedMethodCaller`s bound to different instances share the
 `ArgumentFixer` with the `CachedMethod` that is bound to the class of the
 instances. Hence, it is reasonable to avoid creating the same
 `ArgumentFixer` repeatedly.

 Without the patch, more than 500 `ArgumentFixer`s are created during
 startup of Sage. This is expensive, because one needs to determine the
 argspec of the cached functions/methods (this may even involve reading
 source code!!). With the patch, only 6 `ArgumentFixer`s are created.

--
Ticket URL: <http://trac.sagemath.org/ticket/15038>
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.

Reply via email to