Actions
Feature #17763
closedImplement cache for cvars
Feature #17763:
Implement cache for cvars
Status:
Closed
Assignee:
-
Target version:
-
Description
Introduce inline cache for class variable reads¶
@tenderlove and I would like to introduce an inline cache for class variable reads. We've attached a patch that introduces the cache. Class variable reads are popular in Rails applications for example, Active Record's #logger.
GitHub PR: https://github.com/ruby/ruby/pull/4340
Cache Design¶
This patch introduces a hash table that's stored on the same class as the class variable value.
For example: