Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Significant performance regression with 2.5.1 #261

Open
thardeck opened this issue Aug 12, 2015 · 7 comments
Open

Significant performance regression with 2.5.1 #261

thardeck opened this issue Aug 12, 2015 · 7 comments

Comments

@thardeck
Copy link

So we are using json-schema to verify our json system description.

We are using 2.2.5 by default but if 2.5.1 is installed it will be used automatically if it isn't executed with bundle exec.

These are the results with 2.2.5:
real 0m1.368s

These are the results with 2.5.1:
real 0m12.866s

Even 2.5.0 is slower but not as much:
real 0m5.006s

2.4.1 is as fast as 2.2.5:
real 0m1.551s

These two schemas should be relevant. One for the whole description and the other for the inspector.

I have uploaded a simple json file here, which I used for the above benchmarks.

I don't have time to bisect but if you have an idea what might causing it I can test it. Thx in advance.

@iainbeeston
Copy link
Contributor

Would it be possible for you to try the code from #255 and see if that speeds things up? If so I'll try to get that pull request merged and released (along with #239)

@thardeck
Copy link
Author

Thx for the quick reply.

So I have tested the branch and it is much faster then original 2.5.1 but still slower than 2.4.1:
real 0m2.832s

@iainbeeston
Copy link
Contributor

It seems like the switch from ruby URI to addressable has caused this problem. I'm tempted to make it optional - #285 will make this easier

@thardeck
Copy link
Author

Thx for looking into this but I have tried release 2.6.0 and it is still ~ four times as slow (I have updated the previous values because it was more validated than just the json):

This is with 2.2.5:

> time bundle exec bin/machinery validate tumbleweed
Validation succeeded.

real    0m2.184s
user    0m2.046s
sys     0m0.133s

This is with 2.6.0:

> time bin/machinery validate tumbleweed
Validation succeeded.

real    0m8.309s
user    0m8.182s
sys     0m0.127s
> gem list  | grep schema
json-schema (2.6.0, 2.2.5)

If you want to test any patch or pull request regarding this let me know.

@thardeck
Copy link
Author

I have forgotten to post the example from above: http://pastebin.com/a0nJVvKx

@iainbeeston
Copy link
Contributor

Thanks for sharing that, I'll try to take a look.

@thardeck
Copy link
Author

thardeck commented Jan 4, 2018

While 2.8.0 is much better than 2.5.1 it is still quite slow in comparison to 2.2.5. These values are generated against the example posted above.

2.8.0

real    0m9.611s                                                                                                                                                                       
user    0m9.368s                                                                                                                                                                       
sys     0m0.238s

2.2.5

real    0m2.202s                                                                                                                                                                       
user    0m2.037s                                                                                                                                                                       
sys     0m0.162s

2.5.1

real    0m23.400s
user    0m23.038s
sys     0m0.347s

thardeck added a commit to SUSE/machinery that referenced this issue Jun 25, 2019
While the performance issue is still not completely fixed
voxpupuli/json-schema#261
newer Ruby versions show warnings with the old json-schema versions so
we need to support the newer ones.
thardeck added a commit to SUSE/machinery that referenced this issue Jun 25, 2019
While the performance issue is still not completely fixed
voxpupuli/json-schema#261
newer Ruby versions show warnings with the old json-schema versions so
we need to support the newer ones.

Newer json-schema versions have a littel different error messages that's
why the tests needed to be adapted accordingly.
thardeck added a commit to SUSE/machinery that referenced this issue Jun 25, 2019
While the performance issue is still not completely fixed
voxpupuli/json-schema#261
newer Ruby versions show warnings with the old json-schema versions so
we need to support the newer ones.

Newer json-schema versions have a littel different error messages that's
why the tests needed to be adapted accordingly.
thardeck added a commit to SUSE/machinery that referenced this issue Jun 28, 2019
While the performance issue is still not completely fixed
voxpupuli/json-schema#261
newer Ruby versions show warnings with the old json-schema versions so
we need to support the newer ones.

Newer json-schema versions have a littel different error messages that's
why the tests needed to be adapted accordingly.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants