seznam / elasticlient

C++ Elasticsearch client library
https://seznam.github.io/elasticlient/
MIT License
132 stars 67 forks source link

Json parsing speed too slow #10

Open johniez opened 5 years ago

johniez commented 5 years ago

JsonCpp library used to parse scroll results is extremely slow. Scrolling through larger indices show the delay much more. In numbers: what the current implementation iterates in 85 seconds, scroll implemented using rapidjson did in 25 seconds.

Unfortunately JsonCpp is used in Scroll header interface, so the change would break API/ABI. But the speed is worth it.

Possible implementation with rapidjson (as it is header only library):

First option means that parsing has to be done twice. Internally and then for data parsing itself. Otherwise there is a risk of using different versions (binary incompatible) of rapidjson. The second option allows shared parsing (internall and client's data) without possibility of using different versions of rapidjson (one compiled into elasticlient, another version in client code).