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

Instance vars on dup'ed classes should cache the same #156

Closed
headius opened this issue May 3, 2012 · 2 comments
Closed

Instance vars on dup'ed classes should cache the same #156

headius opened this issue May 3, 2012 · 2 comments

Comments

@headius
Copy link
Member

headius commented May 3, 2012

Instance variables are cached and invalidated by the identity of the nearest concrete class. This works for simple cases, but when the concrete class has been dup'ed from another, even if it does not add any new instance variables, it will cause ivar caches to invalidated.

It appears that ActiveRecord's scope feature uses a lot of dup'ed classes with their own instance variables, preventing any caching. It's unclear whether the dup'ed classes go on to define their own instance vars, but see #155 for evidence that they definitely do not cache properly.

This should be investigated for 1.7. It does not represent a critical issue since we have cached this way for years, but we will have degraded perf until it is improved. Fixing #155 (which I consider critical) will mitigate some of this bug's effects.

@headius
Copy link
Member Author

headius commented Jan 22, 2024

Closing in factor of bullet in #7588. This will be solved by having per-object shapes and intelligent shape caching.

@headius headius closed this as completed Jan 22, 2024
@headius headius added this to the Invalid or Duplicate milestone Jan 22, 2024
@headius
Copy link
Member Author

headius commented Jan 22, 2024

See also #7516 which begins this work.

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

No branches or pull requests

1 participant