My validation schema references other schemas that are hosted on a web server.
The fetching of these external schemas seems to be extremly slow:
I can see with nettop the fetching of theses external schemas is done one by one, could it be multithreaded ?
But even with multi-threaded fetch, it would still be very slow IMO. I can't explain why, but I may be able to give some clues:
This is the time needed to fetch one of the external schemes my main scheme uses:
time curl http://developers.heyvent.overhead.ovh/schemas/uuid > /dev/null
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
100 163 100 163 0 0 713 0 --:--:-- --:--:-- --:--:-- 711
real 0m0.234s
user 0m0.003s
sys 0m0.004s
And now, the time needed to validate a empty json (that wouldn't pass the validation, it's just for the test):
time ./validator.rb schemas/event {} > /dev/null
real 3m46.930s
user 0m0.137s
sys 0m0.023s
My validation schema references other schemas that are hosted on a web server. The fetching of these external schemas seems to be extremly slow:
I can see with
nettop
the fetching of theses external schemas is done one by one, could it be multithreaded ?But even with multi-threaded fetch, it would still be very slow IMO. I can't explain why, but I may be able to give some clues:
Here's the validator.rb script and
schemas/event
JSON schema (I'm new with ruby and just wanted to make a quick working tool so please don't judge this horrible piece of code :smile:)If you need me to test things or give you more information, just tell me ;)