You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Jan 30, 2020. It is now read-only.
$jsonRpc = new \Zend\Json\Server\Client('http://server-url.com');
for ($i = 0; $i < 25000; $i++) {
$jsonRpc->call('someMethod');
}
The method called in the server is a method that only returns hard-coded information, to avoid interferences.
Measuring the time the function spends proves that the time spent in the function gets increased at each request. After 20000+, the time spent by the call lasted more than 2.5 seconds.
I was able to isolate the issue to the merging of headers: in every request done the headers lasted more to be merged. After some analysis, I found out that he internal number of headers were being increased by two at every request.
The headers are added independently of their existence. User-Agent is at least checking its existence before being added, so the solution would be to do the same with "Content-Type" and "Accept".
The text was updated successfully, but these errors were encountered:
Test case:
The method called in the server is a method that only returns hard-coded information, to avoid interferences.
Measuring the time the function spends proves that the time spent in the function gets increased at each request. After 20000+, the time spent by the call lasted more than 2.5 seconds.
I was able to isolate the issue to the merging of headers: in every request done the headers lasted more to be merged. After some analysis, I found out that he internal number of headers were being increased by two at every request.
The code that lead to this is: https://github.com/zendframework/zend-json-server/blob/master/src/Client.php#L121
The headers are added independently of their existence. User-Agent is at least checking its existence before being added, so the solution would be to do the same with "Content-Type" and "Accept".
The text was updated successfully, but these errors were encountered: