# Adopt memo\_wise?

**URL:** <https://discourse.dry-rb.org/t/adopt-memo-wise/1410>\
**Category:** Ideas\
**Created:** [December 23, 2021, 4:59pm UTC](https://discourse.dry-rb.org/t/adopt-memo-wise/1410 "2021-12-23T16:59:17Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![ianks](https://yyz1.discourse-cdn.com/flex031/user_avatar/discourse.dry-rb.org/ianks/32/449_2.png) [@ianks](https://discourse.dry-rb.org/u/ianks)\
**Post date:** [December 23, 2021, 4:59pm UTC](https://discourse.dry-rb.org/t/adopt-memo-wise/1410/1 "2021-12-23T16:59:17Z")

</div>

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?

> **[GitHub - panorama-ed/memo\_wise: The wise choice for Ruby memoization](https://github.com/panorama-ed/memo_wise)**
>
> The wise choice for Ruby memoization. Contribute to panorama-ed/memo\_wise development by creating an account on GitHub.

---

<div class="post-metadata">

**Author:** ![flash-gordon](https://yyz1.discourse-cdn.com/flex031/user_avatar/discourse.dry-rb.org/flash-gordon/32/494_2.png) [@flash-gordon](https://discourse.dry-rb.org/u/flash-gordon)\
**Post date:** [December 24, 2021, 8:52am UTC](https://discourse.dry-rb.org/t/adopt-memo-wise/1410/2 "2021-12-24T08:52:34Z")

</div>

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).

---

<div class="post-metadata">

**Author:** ![solnic](https://yyz1.discourse-cdn.com/flex031/user_avatar/discourse.dry-rb.org/solnic/32/779_2.png) [@solnic](https://discourse.dry-rb.org/u/solnic)\
**Post date:** [December 24, 2021, 9:07am UTC](https://discourse.dry-rb.org/t/adopt-memo-wise/1410/3 "2021-12-24T09:07:35Z")

</div>

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](https://github.com/dry-rb/dry-core/blob/master/lib/dry/core/inflector.rb)

---

<div class="post-metadata">

**Author:** ![ianks](https://yyz1.discourse-cdn.com/flex031/user_avatar/discourse.dry-rb.org/ianks/32/449_2.png) [@ianks](https://discourse.dry-rb.org/u/ianks)\
**Post date:** [December 24, 2021, 10:53pm UTC](https://discourse.dry-rb.org/t/adopt-memo-wise/1410/4 "2021-12-24T22:53:17Z")

</div>

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
