Allow for the configuration of a cache_key_digest method #285
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This will allow someone to use something other than #hash on an object (which will change per VM startup).
Documented in issues #146 and #52; as well as here. Demonstrated here on 2.1.2:
This is especially handy when using something like Redis to cache values which should persist across server restarts and allow for multiple application instances to talk to the same Redis server, or multiple applications sharing the same translation store.
Using something like Digest::MD5 takes double the time as Object#hash. However, the digest value remains consistent for the same raw value across multiple VMs.
I've done some benchmarks using different hashing algorithms and have uploaded the results here.
Props to @yellow5 for his help digging through with me!