Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Speed up actions in coercion model #26775

Closed
jdemeyer opened this issue Nov 27, 2018 · 2 comments
Closed

Speed up actions in coercion model #26775

jdemeyer opened this issue Nov 27, 2018 · 2 comments

Comments

@jdemeyer
Copy link

This is the logic that the coercion model uses when it calls an action:

  1. Get the action object (an Action instance) given the parents of both arguments and the operation. This is cached using TripleDict, so lookup of known actions is fast.

  2. Call the action using the generic __call__ interface.

  3. The action checks again the parents of the arguments.

  4. The actual action method _act_ is called.

Step 3 takes a non-trivial amount of time and is completely unneeded since the coercion model already knows that the parents are correct.

We also remove the (op is not sub) and (op is not isub) checks: I see no reason why actions should not be allowed for subtraction.

Depends on #24500

CC: @tscrim

Component: coercion

Author: Jeroen Demeyer

Issue created by migration from https://trac.sagemath.org/ticket/26775

@jdemeyer jdemeyer added this to the sage-8.5 milestone Nov 27, 2018
@jdemeyer

This comment has been minimized.

@jdemeyer
Copy link
Author

comment:2

Never mind, the description is wrong.

@jdemeyer jdemeyer removed this from the sage-8.5 milestone Nov 27, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant