These folks have done a lot of great work optimizing memoization in Ruby. I propose we adopt it and make Dry::Core::Cache a thin wrapper around the gem. Thoughts?
We won’t pull mandatory dependencies into dry-core because it’s the base layer. It’s probably possible to have an extension that provides the same interface as
Dry::Core::Cache interface but with a different backend. No idea how hard that would be. Alternatively, some improvements from memo_wise, can be made in dry-core (I already applied some but it’s a tedious time-consuming work).
What Nikita said + we have a similar situation with inflections in dry-core, where it supports multiple backends dry-core/inflector.rb at master · dry-rb/dry-core · GitHub
Re-implementing might be the best way. I know gems in ROM make heavy use of memoization, so i feel the benefits could be noteworthy