ring-clojure / ring-codec

Utility library for encoding and decoding data
MIT License
63 stars 30 forks source link

Performance: Lookup charset once instead of every call #40

Closed bsless closed 1 year ago

bsless commented 1 year ago

Specifying the encoding format as string incurs a lookup for every call of decode.

We can pull it out to one lookup and an instance check, gaining some more performance in the default cases.

This is an offshoot of #37, but since we agreed to split the changes to separate PRs, I thought having a related issue to track it would be appropriate.