voxpupuli / json-schema

Ruby JSON Schema Validator
MIT License
1.53k stars 242 forks source link

Redux: speed up JSON::Validator.validate #285

Closed iainbeeston closed 8 years ago

iainbeeston commented 8 years ago

This is a rebase and update of #255

I've pulled out the change to the way uuids are calculated (in #255 the uuid of a Hash is calculated by taking a SHA of Hash.hash, whereas in the original the SHA of the string of the hash is used) because I feel that the risk is high and a better solution would be to use a faster hashing algorithm.

However, I've expanded the use of caching to get around the speed problems in Addressable.

Worst case this should be faster than the current implementation.

iainbeeston commented 8 years ago

If I can get this reviewed I'd like to release as v2.6.0

iainbeeston commented 8 years ago

I've refactored slightly to duplicate cached URIs rather than freezing them

iainbeeston commented 8 years ago

(Because in addressable dup is cheaper than freeze)

RST-J commented 8 years ago

Looks fine to me :+1:

iainbeeston commented 8 years ago

Thanks. I'll merge this and make a release

On 7 Jan 2016, at 8:33 pm, Jonas Peschla notifications@github.com wrote:

Looks fine to me

— Reply to this email directly or view it on GitHub.