gcanti / io-ts

Runtime type system for IO decoding/encoding
https://gcanti.github.io/io-ts/
MIT License
6.68k stars 331 forks source link

Cache all strings #700

Closed matray closed 1 year ago

matray commented 1 year ago

Re-using codecs becomes a really memory costly operation, even lightly CPU intensive too - creating codec strings over and over again that can't be de-duped or reused. This is an attempt to cache all strings used for "names". Very open to feedback here.

Before submitting a pull request, please make sure the following is done:

Note. If you find a typo in the documentation, make sure to modify the corresponding source (docs are generated).

matray commented 1 year ago

Re-opening this one, it's not the most fp implementation, but I'm open to feedback there :)

matray commented 1 year ago

Ha! closing again, discussed internally with my team, looks to be user error that these are being created over and over again.