#11342: Make getattr faster on parents and elements
---------------------------+------------------------------------------------
Reporter: SimonKing | Owner: tbd
Type: enhancement | Status: needs_review
Priority: major | Milestone: sage-4.7.1
Component: performance | Keywords: getattr parent element
Work_issues: | Upstream: N/A
Reviewer: | Author: Simon King
Merged: | Dependencies: #9944
---------------------------+------------------------------------------------
Comment(by hivert):
> So, it is nearly eight times slower than using `raise_attribute_error`
in unpatched sage, and about fifty times slower than using
`AttributeErrorMessage`, which was only 3 seconds for `10^7` (not `10^6`)
iterations, and which ''does'' preserve the old error messages.
As I already said: [It] is pure Python so that probably a little
Cythonizing is needed if it fits you needs.
Plus compared to your code I have have to pay the extra cost of calling
the operator {{{__mod__}}} for {{{%}}} when binding the string to its
extra args. If you want speed from cython, it would be better to have this
extra binding in a non standard def method so that you can bypass the call
to python interpreter. Do you accept a little slow down (calling %) as a
trade-off to avoid code and feature duplication ?
--
Ticket URL: <http://trac.sagemath.org/sage_trac/ticket/11342#comment:6>
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.