-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
Implement a method cache for faster dispatch and allowing super calls #849
Conversation
6369b04
to
8524e40
Compare
This is interesting. @guilleiguaran @joaomdmoura can you chime in? |
Oh I forgot to mention. This technique only works for ruby 2.0+. ActiveRecord up to 4.2 had a fallback. I don't know if it's worth implementing it since 1.9.3 is EOL. But I can do it if it's important. |
@byroot We've dropping support for Ruby < 2.0 in master, so this is again viable. Would you be interested in rebasing this off of current master? Let me know if I can help. |
I'll try to find some time. |
Awesome! B mobile phone
|
af84b2e
to
5b0bf60
Compare
So I looked into it, and given the way it's implemented now with The idea was to generate attributes accessor dynamically via If we were doing that on AttributeReader, it would generate a |
The code is heavily borrowed from ActiveRecord.
It should make the attribute methods faster even though I didn't write any benchmark to back that claim.
The real reason I implemented this, is to be able to use
super
in attribute methods:Regards.