Added pfunc profiling to braceSubstitution()
authorAaron Schulz <aaron@users.mediawiki.org>
Thu, 27 Oct 2011 21:53:37 +0000 (21:53 +0000)
committerAaron Schulz <aaron@users.mediawiki.org>
Thu, 27 Oct 2011 21:53:37 +0000 (21:53 +0000)
includes/parser/Parser.php

index e281ff6..f95a216 100644 (file)
@@ -3132,6 +3132,7 @@ class Parser {
                                        }
                                }
                                if ( $function ) {
+                                       wfProfileIn( __METHOD__ . '-pfunc-' . $function );
                                        list( $callback, $flags ) = $this->mFunctionHooks[$function];
                                        $initialArgs = array( &$this );
                                        $funcArgs = array( trim( substr( $part1, $colonPos + 1 ) ) );
@@ -3153,6 +3154,7 @@ class Parser {
 
                                        # Workaround for PHP bug 35229 and similar
                                        if ( !is_callable( $callback ) ) {
+                                               wfProfileOut( __METHOD__ . '-pfunc-' . $function );
                                                wfProfileOut( __METHOD__ . '-pfunc' );
                                                wfProfileOut( __METHOD__ );
                                                throw new MWException( "Tag hook for $function is not callable\n" );
@@ -3178,6 +3180,7 @@ class Parser {
                                                $text = $this->preprocessToDom( $text, $preprocessFlags );
                                                $isChildObj = true;
                                        }
+                                       wfProfileOut( __METHOD__ . '-pfunc-' . $function );
                                }
                        }
                        wfProfileOut( __METHOD__ . '-pfunc' );