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

Simplify Hooks #2279

Open
wants to merge 2 commits into
base: dev
Choose a base branch
from
Open

Conversation

deckar01
Copy link
Member

@deckar01 deckar01 commented Jun 6, 2024

  • Replace slow tuple-keyed dicts with string-keyed dicts
  • Load the hook config into cls._hook at setup rather than searching fn.__marshmallow_hook__ at run-time
  • Skip mismatched many hooks while iterating rather than indexing and filtering them
  • pypy (3.10): ~30% speedup
  • cpython (3.10): <1% difference
  • cpython (3.11, 3.12): ~3.5% speedup

@deckar01
Copy link
Member Author

deckar01 commented Jun 6, 2024

Follow up to #2277 (comment).

@lafrech
Copy link
Member

lafrech commented Jun 9, 2024 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants