From 5012ac6c6a7bea9971b2e44eca73ece2dab748bc Mon Sep 17 00:00:00 2001 From: Aaron Schulz Date: Wed, 25 Mar 2015 20:50:41 -0700 Subject: [PATCH] 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 --- includes/profiler/Profiler.php | 2 +- includes/profiler/ProfilerStub.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) 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() { -- 2.20.1