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

optimize responses evaluation for large size ResultSets #18

Open
vpapako opened this issue Mar 29, 2018 · 0 comments
Open

optimize responses evaluation for large size ResultSets #18

vpapako opened this issue Mar 29, 2018 · 0 comments
Assignees

Comments

@vpapako
Copy link
Collaborator

vpapako commented Mar 29, 2018

To evaluate a response, the JSON formatted expected and received data are read as Jena result sets.

ResultSet rs = ResultSetFactory.fromJSON(new ByteArrayInputStream(byte[] results));

If the result set size is greater than 50.000 rows, only the number of rows compared, otherwise the result sets themselves are compared:

ResultSetCompare.equalsByValue(ResultSet expected, ResultSet received)

In cases where the result set composed of dozens of thousands of rows, constructing a jena ResultSet from JSON data may become very costly.

A JSON library that supports streaming operations on JSON Objects like Jackson or Gson (so no OOM issues will occur) could be used for counting a result set's size. If such size is greater than 50.000 the already computed result sets sizes will be compared. Otherwise, the jena ResultSet construction will proceed for comparing the result sets themselves for equality.

@vpapako vpapako self-assigned this Mar 29, 2018
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

1 participant