Skip to content

Avoid metaprogramming when bulk setting attributes.#2

Open
wcerfgba wants to merge 1 commit intomasterfrom
setattrs-no-dynamic
Open

Avoid metaprogramming when bulk setting attributes.#2
wcerfgba wants to merge 1 commit intomasterfrom
setattrs-no-dynamic

Conversation

@wcerfgba
Copy link
Copy Markdown
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