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

Performance and functional comparison #29

Open
big-andy-coates opened this issue Oct 21, 2023 · 13 comments
Open

Performance and functional comparison #29

big-andy-coates opened this issue Oct 21, 2023 · 13 comments

Comments

@big-andy-coates
Copy link
Contributor

Hi,

I've recently needed to compare the performance and functionality of this and other JVM based JSON validation libraries, and I thought you might like to see how this implementation compares. I've published to the code and the results here: https://github.com/creek-service/json-schema-validation-comparison.

While I've spent time trying to get the best out of each library under test, it's possible that the results for this implementation could be improved if someone with more in-depth knowledge were to look into it. If you feel I'm not showing in its best light, please feel free to raise PRs to fix issues and improve your score.

Please feel free to link to the code and results.

I hope this is of some use to you.

Thanks,

Andy

@erosb
Copy link
Owner

erosb commented Oct 21, 2023 via email

@big-andy-coates
Copy link
Contributor Author

At the moment no, it's just using the standard set of JSON schema test cases. Do you think it would be useful to add a large JSON schema?

@erosb
Copy link
Owner

erosb commented Oct 23, 2023

Hello @big-andy-coates yes, I think it would make sense, some users were reporting performance problems when using very big schemas. The FHIR project maintains a huge schema you can use for perf tests.

Also I'm not sure if you are aware of the Bowtie project, which is not specific to Java, but has a very similar goal to your evauation - you may want to keep an eye on it.

@big-andy-coates
Copy link
Contributor Author

Thanks @erosb,

I'm talking with the people behind Bowtie. (I wasn't aware, but they reached out). They're covering the functional side, but not the perf side, which is much more language specific. I'll be helping them a bit adding coverage for implementations they don't have yet.

I'll see if I can find time to add a large schema perf test. Though, if I'm honest, that doesn't really fit the use case I was doing the comparison for.

If you have time, would you mind raising an issue with an example large schema and document(s). Of course, if you were to raise a PR as well, that would be super useful :)

@big-andy-coates
Copy link
Contributor Author

When I last looked at this repo it seemed to still be in initial development, as a fair number of required functional tests failed. Was that / is that assumption correct?

@erosb
Copy link
Owner

erosb commented Oct 26, 2023

Hello @big-andy-coates , the support for $dynamicRef and $dynamicAnchor is partial, the rest should be (almost) stable.

@erosb
Copy link
Owner

erosb commented Oct 27, 2023

Hello @big-andy-coates I wanted to raise an issue for your project but couldn't (the "Submit Issue" button is disabled for me) so I'm putting this here:

would you mind raising an issue with an example large schema and document(s)

I think it would make sense to test with some reasonably big schemas and instances, since the JSON Schema Test Suite works with very small jsons (both schemas and instances) which are very specific to the actual testcases.

So I suggest gathering some more realistic testcases. One potential way would be testing with the FHIR schema, but not sure.

I remember @octavianN you faced performance issues with OxygenXML (which uses everit-org/json-schema) in the past, maybe you can help out here, do you have a good testsuite for performance testing the schema validators?

An other matter regarding the comparisons (we may track it in a separate issue): most java libraries implement:

  • a separate schema loading phase (when the schema json is mapped to a java model)
  • and a validation phase (where a json instance is validated against the java model).

Regarding that, for most applications, the validation phase has much higher importance regarding the 2nd phase (validation), since very often the schema gets loaded only once per application lifecycle, then the validation runs several times. I'm not sure if/how the current benchmark handles this separation.

@octavianN
Copy link

Hi,

We ran the JSON Schema Test suite and as part of the performance evaluation we used larger schemas such as:

@erosb
Copy link
Owner

erosb commented Oct 27, 2023

Thank you for your input @octavianN !

@big-andy-coates
Copy link
Contributor Author

the "Submit Issue" button is disabled for me

Summit button will only be disabled if you didn't add a title to the issue. (Standard for Github).

Will you please do me a favour and confirm. I've tested this end with a different login, but I'd like to confirm I don't have an issue with access :)

@big-andy-coates
Copy link
Contributor Author

An other matter regarding the comparisons (we may track it in a separate issue): most java libraries implement:

  • a separate schema loading phase (when the schema json is mapped to a java model)
  • and a validation phase (where a json instance is validated against the java model).

Regarding that, for most applications, the validation phase has much higher importance regarding the 2nd phase (validation), since very often the schema gets loaded only once per application lifecycle, then the validation runs several times. I'm not sure if/how the current benchmark handles this separation.

Agreed, for this reason the performance tests only cover the second part, i.e. the validation, not the loading / parsing of schemas.

@big-andy-coates
Copy link
Contributor Author

@octavianN any chance I could trouble you to create an issue under https://github.com/creek-service/json-schema-validation-comparison with a sample schema and JSON document?

@big-andy-coates
Copy link
Contributor Author

FYI, microsite with performance and functionality comparison is now live: https://www.creekservice.org/json-schema-validation-comparison/

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

3 participants