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

inspect.Signature is slow. #4

Closed
seandstewart opened this issue Jul 3, 2019 · 1 comment
Closed

inspect.Signature is slow. #4

seandstewart opened this issue Jul 3, 2019 · 1 comment
Assignees
Labels
enhancement New feature or request
Projects

Comments

@seandstewart
Copy link
Owner

Currently, the largest bottle-neck for coercing callable inputs is the inspect.Signature object and binding inputs to the function args, which we need to do manually so that we can coerce to the appropriate type.

In my testing, running a simple function with one or two args is up to 100x slower as a result of using that object.

@seandstewart seandstewart added the enhancement New feature or request label Jul 3, 2019
@seandstewart seandstewart self-assigned this Jul 3, 2019
@seandstewart seandstewart added this to To do in Performance via automation Jul 3, 2019
@seandstewart seandstewart moved this from To do to In progress in Performance Jul 28, 2019
@seandstewart seandstewart moved this from In progress to Done in Performance Oct 11, 2019
@seandstewart
Copy link
Owner Author

A custom implementation of bind is about 20%-30% faster. I've also added coercing at time of binding, so we're saving there.

For now, I'm not going to re-implement inspect.signature as a review of the current implementation didn't reveal any low-hanging fruit for improving performance. We'll instead rely on util.cached_signature for now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
No open projects
Performance
  
Done
Development

No branches or pull requests

1 participant