Open dizer opened 5 years ago
Could you provide more details in the commit message?
I'm very interested to learn more about the implications of these changes in your test suite, is that something that you've measured?
Hi @seanpdoyle
You can try benchmarks at https://github.com/dizer/json_matchers_cache
Original, single document, 1000 tries:
0.99 sec
Original, linked document, 1000 tries:
5.68 sec
Patched, single document, 1000 tries:
0.52 sec
Patched, linked document, 1000 tries:
0.92 sec
For our requests tests suite (124 JSON schema files, 5047 lines) it saved about a minute.
Hi @seanpdoyle, any chance to get it merged? This feature is very helpful, with this patched version our specs working faster (3-4 minutes vs 20 minutes).
If you don't have time to resolve conflicts let me know, I'll create a new PR.
Hi @seanpdoyle. We also have same issues with speed in our tests after upgrade from 0.9 to 0.11 version. Could you merge this patch?
@seanpdoyle Please help take a look at this when you have a chance, thanks!
Now every match_json_schema call reloads the whole schema from disk. It may slow when there are many files (~1 second for each test example in our case).
This PR caches document store on the class level.