Closed jwpage closed 6 years ago
Thanks for the pull request @jwpage! This pull request looks good to me.
@ivanakimov what do you say?
@vinkla @jwpage this is super awesome.
@jwpage thanks for providing benchmarks as well! I was trying to think of any scenarios where this might break anything, but I guess besides memory consumption if the tests are good, this should be a nice optimization.
@vinkla if looks good to you, let's get it out!
Merged! This will be part of version 2.1 which will be released in the coming weeks. For now, you could set minimum-stability
to dev
and start using version 2.1
in development today.
This changes the Hashids::bench function so that it will store a shuffled alphabet once it's been created. This increases the performance of the function, especially when calculating large numbers of hashes.
Here are a couple of blackfire.io profiles for encoding 50,000 hashes.