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

Avoid metaprogramming when bulk setting attributes. #2

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

wcerfgba
Copy link
Contributor

We extract key normalisation from method_missing so we can use it in []=, so that attributes= does not have to go through method_missing to get to set_attribute.

On my local this yields a ~20% decrease in deserialization time.

This has passed unit tests on my local, and I've tested guide creation, which @joeforshaw noticed was broken after the last perf attempt on this module. 😹

We extract key normalisation from `method_missing` so we can use it in `[]=`, so that `attributes=` does not have to go through `method_missing` to get to `set_attribute`.

On my local this yields a ~20% decrease in deserialization time.
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.

1 participant