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

Do the benchmark on a more realistic schema #11

Closed
ebdrup opened this issue Feb 1, 2015 · 4 comments
Closed

Do the benchmark on a more realistic schema #11

ebdrup opened this issue Feb 1, 2015 · 4 comments

Comments

@ebdrup
Copy link
Owner

ebdrup commented Feb 1, 2015

The current benchmark is run on a subset of the tests in the official JSON-schema test suite.
Although the results seem very much in line with what other stable benchmarks produce (like themis), and exercising as much of the standard as possible is good to catch any slow corners in a validator. It might be a good idea to do a benchmark on data that is more like what you see in production.

Perhaps an performance benchmark on one simple and one advanced schema.

To keep things simple for anyone wanting to chose a validator, the benchmark should still produce one single number for each validator like it does now. Nitty gritty details about performance are for schema validator authors to do in their efforts.

@ebdrup
Copy link
Owner Author

ebdrup commented Feb 1, 2015

I was thinking of machine-generating a bigger schema from the schemas in the official tests, to make sure that the test touches as many parts of the spec as possible. Just to make sure to hit any troublesome parts of a validator.

@gilesbowkett
Copy link

ok, so the bad news is I don't have as much time as I'd like, but the JSCK benchmarks use five schemas, and you're more than welcome to use them.

here's a categorization of those 5 schemas:

  • draft 3, trivial
  • draft 3, medium
  • draft 4, trivial
  • draft 4, medium
  • draft 4, complex

so you can use them to benchmark a range of complexities and draft support.

@JamesNK
Copy link

JamesNK commented Aug 28, 2015

Realistic benchmark idea: Validating the draft 4 schema with the draft 4 schema.

@ebdrup ebdrup closed this as completed Jul 20, 2017
@epoberezkin
Copy link
Collaborator

@ebdrup The more I think about it, the more I believe that using test-suite for performance benchmarking is completely wrong.

With the exception of some really old and slow libraries, where slow validation may affect UX in the browser, validation performance only really matters for server-side validation. This is where the performance advantage achieved by compiling validators is becoming important... Server-side validation passes 99+% of the time (excluding the cases of DOS attacks and or broken API consumer - but performance is not going to help too much in these cases).

So I think to be relevant, benchmark should only test passing cases on some data samples of small/average/large size.

Tests can still be used to benchmark compliance, separately from performance.

What do you think?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants