danivek/json-api-serializer

Use a cache for converting to snake/camel/kebab case

alechirsch opened this issue · 1 comments

I noticed while doing some testing that converting to kebab-case for serialization cause the performance to take a hit by over 2x.

For example, without converting it took 90ms to serialize my data, and with converting it took 250ms to serialize.

I created a benchmark test to show a proposal, I am happy to put out a PR if you agree with this performance enhancement.

http://jsben.ch/bqUbq

Hi @alechirsch,
Of course, I totally agree with this improvement.
PR is welcome 👍

See _convertCase function