After cleaning up some code related to homsets in #23905, I noticed that the new code was about 20% to 30% slower in some cases. I traced this difference to a call

R = parent(x)

where x was a Python function (so, not a Sage Element).

It turns out that parent(x) tries to call x.parent(). If that fails, then type(x) is returned. If I change the code of parent() to always return type(x) for non-Elements, the slowdown on #23905 goes away.

So the question is: should parent(x) call x.parent() for non-Elements? See Trac #23912.

--
You received this message because you are subscribed to the Google Groups 
"sage-devel" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sage-devel+unsubscr...@googlegroups.com.
To post to this group, send email to sage-devel@googlegroups.com.
Visit this group at https://groups.google.com/group/sage-devel.
For more options, visit https://groups.google.com/d/optout.

Reply via email to