I'm having trouble with the performance of the Transportclient using the Java API, which is magnitudes slower compared to using the REST client.
If found a similiar thread here:
and read the benchmark comparison:
While measuring the execution time I figured out, that the performance on server-side is in both cases the same (looking at the "took" parameter in the SearchResponse).
What seems to take a lot of time (well, its my guess) is the async execution in the Transportclient.
Measuring of the Transportclient:
SearchRequestBuilder srb = ...; srb.execute().actionGet()
I've just enclosed the
srb.execute().actionGet() by time measuring.
Measuring of the REST client:
restClient.performRequest("GET", "/...", Collections.<String, String>emptyMap(), new NStringEntity(..)
I've filled NStringEntity(...) with the JSON-output of SearchRequestBuilder used with the TransportClient.
REST client: about 35-40ms
Transport client: about 1200ms ("took" parameter in the SearchResponse is low, about 5-10ms)
I'm just measuring the time of sending to receiving the data. No building the query etc.
Is that explainable or is there any misconfiguration possible when initializing the Transportclient that leads to this behaviour?