#11342: Make getattr faster on parents and elements
---------------------------+------------------------------------------------
Reporter: SimonKing | Owner:
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 SimonKing):
Replying to [comment:7 hivert]:
> Some more info: According to prun most of the time is spend during the
copy in
> [__mod__].
>...
> I'm pretty sure that cythonizing properly this copy should give a large
> speedup. So the question is: should we try to optimize {{{LazyFormat}}}
or do
> you rather have a hand tuned err-message to ensure proper backward
> compatibility ?
Backward compatibility is one thing.
In addition I don't think that you can come up to speed, even with cython,
if you need to copy strings etc. The point of `AttributeErrorMessage` is
to assign two attributes (without copying, so, it just sets two pointers
to existing objects) ''and nothing else''.
Of course, you may try to tune the lazy format strings so that they are
fast enough for the application here. But for the moment, I really don't
see why one should not introduce a very slim new class (it only has
`__init__` and `__repr__`), if it is faster and offers backward
compatibility for free.
--
Ticket URL: <http://trac.sagemath.org/sage_trac/ticket/11342#comment:9>
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.