# A couple easy Inflector extensions

**URL:** <https://discourse.dry-rb.org/t/a-couple-easy-inflector-extensions/1451>\
**Category:** Ideas\
**Created:** [April 7, 2022, 8:24pm UTC](https://discourse.dry-rb.org/t/a-couple-easy-inflector-extensions/1451 "2022-04-07T20:24:09Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![alassek](https://yyz1.discourse-cdn.com/flex031/user_avatar/discourse.dry-rb.org/alassek/32/314_2.png) [@alassek](https://discourse.dry-rb.org/u/alassek)\
**Post date:** [April 7, 2022, 8:24pm UTC](https://discourse.dry-rb.org/t/a-couple-easy-inflector-extensions/1451/1 "2022-04-07T20:24:09Z")

</div>

Any interest in some dry-inflector extensions that implement [`fast_underscore`](https://github.com/kddnewton/fast_underscore) and [`fast_camelize`](https://github.com/kddnewton/fast_camelize)?

```auto
$ bin/bench
Warming up --------------------------------------
       dry-inflector 4.000 i/100ms
      FastUnderscore 88.000 i/100ms
Calculating -------------------------------------
       dry-inflector 47.403 (± 2.1%) i/s - 240.000 in 5.063972s
      FastUnderscore 890.356 (± 1.2%) i/s - 4.488k in 5.041392s

Comparison:
      FastUnderscore: 890.4 i/s
       dry-inflector: 47.4 i/s - 18.78x (± 0.00) slower

```

---

<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:** [April 8, 2022, 8:44am UTC](https://discourse.dry-rb.org/t/a-couple-easy-inflector-extensions/1451/2 "2022-04-08T08:44:20Z")

</div>

We could have that but my long term goal has been to have a common library with all kinds for transformation functions and a public API for replacing some functions with faster implementations. This way we could have things like dry-logic’s predicates or dry-transformer’s transformations re-implemented as C or Rust extensions and everything that relies on them would automatically benefit. This means I actually see various methods in dry-inflector as something we could extract into…not sure where yet 🙂 Maybe dry-transformer, maybe some new dry-? lib.

---

<div class="post-metadata">

**Author:** ![alassek](https://yyz1.discourse-cdn.com/flex031/user_avatar/discourse.dry-rb.org/alassek/32/314_2.png) [@alassek](https://discourse.dry-rb.org/u/alassek)\
**Post date:** [April 20, 2022, 6:42pm UTC](https://discourse.dry-rb.org/t/a-couple-easy-inflector-extensions/1451/3 "2022-04-20T18:42:00Z")

</div>

I am keeping an eye on the upcoming official Rust support with great interest. That is probably a more fruitful avenue for optimizing things like this rather than adding dependencies.
