Generate callstack value from inside Profiler::saveTimestamp

- Save a massive amount of time computing callstacks when profiling is disabled
This commit is contained in:
Hypolite Petovan 2020-07-27 00:22:07 -04:00
parent 19141b1bcf
commit afb882048e
13 changed files with 42 additions and 39 deletions

View file

@ -199,7 +199,7 @@ class HTTPRequest implements IHTTPRequest
@curl_close($ch);
$this->profiler->saveTimestamp($stamp1, 'network', System::callstack());
$this->profiler->saveTimestamp($stamp1, 'network');
return $curlResponse;
}
@ -285,7 +285,7 @@ class HTTPRequest implements IHTTPRequest
curl_close($ch);
$this->profiler->saveTimestamp($stamp1, 'network', System::callstack());
$this->profiler->saveTimestamp($stamp1, 'network');
// Very old versions of Lighttpd don't like the "Expect" header, so we remove it when needed
if ($curlResponse->getReturnCode() == 417) {
@ -335,7 +335,7 @@ class HTTPRequest implements IHTTPRequest
$http_code = $curl_info['http_code'];
curl_close($ch);
$this->profiler->saveTimestamp($stamp1, "network", System::callstack());
$this->profiler->saveTimestamp($stamp1, "network");
if ($http_code == 0) {
return $url;
@ -377,7 +377,7 @@ class HTTPRequest implements IHTTPRequest
$body = curl_exec($ch);
curl_close($ch);
$this->profiler->saveTimestamp($stamp1, "network", System::callstack());
$this->profiler->saveTimestamp($stamp1, "network");
if (trim($body) == "") {
return $url;