Avoid unnecessary JSON parsing of Elasticsearch responses

Description

We could avoid JSON parsing altogether in some cases. For instance, right now when we create a document and receive a HTTP status 200 response, we parse the response, but we don't do anything about it. We probably could avoid this parsing. Not sure the performance impact would be high though, since we try to bulk such requests, and when receiving a bulk response we definitely need to parse the response (it contains the HTTP status code for each bulked request).

Let's investigate a bit whether 1) JSON parsing has a big impact on overall performance and 2) we can implement some kind of lazy parsing easily.

Environment

None

Activity

Show:
Yoann Rodière
July 26, 2017, 8:46 AM

Closing because:

1. After a bit of profiling, it turns out that, regarding both allocations and execution time, the JSON writing is by far the most expensive operation (almost by an order of magnitude)
2. We mostly parse bulk responses, for which we definitely need parsing (so that we know the status code for each bulked operation)

For these reasons, optimizing parsing (making it more efficient) is likely a better approach than trying to avoid parsing: see

Assignee

Unassigned

Reporter

Yoann Rodière

Labels

Suitable for new contributors

None

Pull Request

None

Feedback Requested

None

Components

Priority

Major
Configure