#14615: cythonize lazy_atrtibute
-------------------------------+--------------------------------------------
Reporter: nbruin | Owner: tbd
Type: enhancement | Status: needs_review
Priority: major | Milestone: sage-5.10
Component: performance | Resolution:
Keywords: | Work issues:
Report Upstream: N/A | Reviewers: Travis Scrimshaw
Authors: Nils Bruin | Merged in:
Dependencies: | Stopgaps:
-------------------------------+--------------------------------------------
Comment (by tscrim):
Replying to [comment:5 nbruin]:
> Great! thank you. I tried but failed to coerce hg into producing such a
patch. I'm definitely happy with your changes. I'm just not sure that
merging this ticket is actually an improvement. The only `*.pyx` file in
which I was able to find a use of `lazy_attribute` is for `_element_class`
on `Parent`.
Then should we expect this result in a speedup for creating parent
objects?
> On python classes (with a `__dict__`) it will be very hard for the
implementation to be critical, since most usage won't use the
implementation anyway. I can imagine that loading an extension class has
larger overhead than a conventional `*.pyc`, in which case there is
actually a ''penalty'' for cythonizing, and I'm not sure we're getting a
benefit in return.
>
> It's good to have, so that people can use `lazy_attribute` for more time
critical applications. Should we be merging this ticket in anticipation of
such applications arising?
However `lazy_attribute` isn't an extension class since it isn't
`cdef`'ed, correct? In either case, could we do something similar to
`cached_method` to get around any penalties (I believe `cached_method` can
be/is faster than python attribute lookup)? Or is the penalty you're
referring to a loading/startup penalty? Actually, one more
question/comment, shouldn't `lazy_attribute` be faster than
`chached_method` with no arguements? I'll also look at it and run some
tests later today.
I think we should be merging (some version of) this ticket precisely for
the reason you stated.
Best,[[BR]]
Travis
--
Ticket URL: <http://trac.sagemath.org/sage_trac/ticket/14615#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 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?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.