From 74ce4c27107966ad85a1b810d180f52f7bddf64d Mon Sep 17 00:00:00 2001 From: Hypolite Petovan Date: Fri, 21 Oct 2016 22:50:58 -0400 Subject: [PATCH] Makes save_timestamp conditional - Add a .htconfig check to save_timestamp to prevent systematic profiling - Removes unused `mark_timestamp()` function including deleted code comment --- boot.php | 8 +++----- object/Conversation.php | 1 - 2 files changed, 3 insertions(+), 6 deletions(-) diff --git a/boot.php b/boot.php index f39fb0369c..0c25dfef3d 100644 --- a/boot.php +++ b/boot.php @@ -1100,6 +1100,9 @@ class App { } function save_timestamp($stamp, $value) { + if (!isset($a->config['system']['profiler']) || !$a->config['system']['profiler']) + return; + $duration = (float)(microtime(true)-$stamp); if (!isset($this->performance[$value])) { @@ -1176,11 +1179,6 @@ class App { return implode(", ", $callstack); } - function mark_timestamp($mark) { - //$this->performance["markstart"] -= microtime(true) - $this->performance["marktime"]; - $this->performance["markstart"] = microtime(true) - $this->performance["markstart"] - $this->performance["marktime"]; - } - function get_useragent() { return(FRIENDICA_PLATFORM." '".FRIENDICA_CODENAME."' ".FRIENDICA_VERSION."-".DB_UPDATE_VERSION."; ".$this->get_baseurl()); } diff --git a/object/Conversation.php b/object/Conversation.php index 94eed94d5f..36c06c6d62 100644 --- a/object/Conversation.php +++ b/object/Conversation.php @@ -145,7 +145,6 @@ class Conversation extends BaseObject { $result[] = $item_data; } - //$a->mark_timestamp(); return $result; } -- 2.39.5