I suspect the following code, is maybe causing down-graded performance:
In FetchAndParseJson():
std::stringstream body;
body.str(); // <--- here
Is a stringstream indeed slow in converting 'large' data to a string?
Another cause could be in ParseJson:
Additional debugging and performance measurements are required!
I see it takes 6ms to execute a simple swarm/peers request. Sure, this specific call could take longer. Yet other API calls are executed (far) below 1ms. And the difference with curl command doesn't show much time differences between those different API calls.
The main difference is the body response size.
Just a thought experiment. Again, does requires follow-up research.
I suspect the following code, is maybe causing down-graded performance:
In
FetchAndParseJson():std::stringstream body; body.str(); // <--- hereIs a
stringstreamindeed slow in converting 'large' data to a string?Another cause could be in
ParseJson:Json::parse(input);Additional debugging and performance measurements are required!
I see it takes 6ms to execute a simple swarm/peers request. Sure, this specific call could take longer. Yet other API calls are executed (far) below 1ms. And the difference with
curlcommand doesn't show much time differences between those different API calls.The main difference is the body response size.
Just a thought experiment. Again, does requires follow-up research.