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

Merged
merged 2 commits into from
Aug 20, 2024
Merged

Simplify Hooks #2279

merged 2 commits into from
Aug 20, 2024

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

@lafrech lafrech mentioned this pull request Aug 20, 2024
@lafrech lafrech merged commit 7609530 into marshmallow-code:dev Aug 20, 2024
9 checks passed
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.

3 participants