From: Aaron Schulz Date: Thu, 26 Mar 2015 03:50:41 +0000 (-0700) Subject: Made ProfilerStub return null instead of a dummy ScopedCallback X-Git-Tag: 1.31.0-rc.0~11969^2 X-Git-Url: http://git.cyclocoop.org/%24self?a=commitdiff_plain;h=5012ac6c6a7bea9971b2e44eca73ece2dab748bc;p=lhc%2Fweb%2Fwiklou.git Made ProfilerStub return null instead of a dummy ScopedCallback * This can happen well over 10k times per request due to the message hooks. Avoiding the object construction seems prudent. Change-Id: I45ff7b8c10851f15a25cbea9a2df3669ec21dbd3 --- diff --git a/includes/profiler/Profiler.php b/includes/profiler/Profiler.php index 69470fd95f..1c9824ab9c 100644 --- a/includes/profiler/Profiler.php +++ b/includes/profiler/Profiler.php @@ -134,7 +134,7 @@ abstract class Profiler { /** * @param ScopedCallback $section */ - public function scopedProfileOut( ScopedCallback &$section ) { + public function scopedProfileOut( ScopedCallback &$section = null ) { $section = null; } diff --git a/includes/profiler/ProfilerStub.php b/includes/profiler/ProfilerStub.php index 5580f943d8..1d04536ee3 100644 --- a/includes/profiler/ProfilerStub.php +++ b/includes/profiler/ProfilerStub.php @@ -28,7 +28,7 @@ */ class ProfilerStub extends Profiler { public function scopedProfileIn( $section ) { - return new ScopedCallback( null ); // no-op + return null; // no-op } public function getFunctionStats() {