Skip to content

Instantly share code, notes, and snippets.

@texpert
Created March 19, 2021 10:39
Show Gist options
  • Save texpert/13e933261e684f0eb945777fdf1ebb7c to your computer and use it in GitHub Desktop.
Save texpert/13e933261e684f0eb945777fdf1ebb7c to your computer and use it in GitHub Desktop.
DCI pattern in Ruby and methods cache in MRI
An interesting line-up of articles about DCI pattern in Ruby and methods cache in MRI
(one of the reasons to avoid OpenStruct is methods cache invalidation on every OpenStruct instantiation):
https://tonyarcieri.com/dci-in-ruby-is-completely-broken
https://dec0de.me/2013/02/dci-performance
https://jamesgolick.com/2013/4/14/mris-method-caches.html
https://shopify.engineering/17489064-tuning-rubys-global-method-cache
https://mensfeld.pl/2015/04/ruby-global-method-cache-invalidation-impact-on-a-single-and-multithreaded-applications/
https://tenderlovemaking.com/2015/12/23/inline-caching-in-mri.html
The articles are quite old, can't find more recent info.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment