Add some profiling points
authorBrion Vibber <brion@users.mediawiki.org>
Sun, 22 Aug 2004 09:07:31 +0000 (09:07 +0000)
committerBrion Vibber <brion@users.mediawiki.org>
Sun, 22 Aug 2004 09:07:31 +0000 (09:07 +0000)
index.php
languages/LanguageUtf8.php

index ee3e56d..3ea90f6 100644 (file)
--- a/index.php
+++ b/index.php
@@ -60,6 +60,7 @@ if ( !is_null( $wgTitle ) && !$wgTitle->userCanRead() ) {
        exit;
 }
 
+wfProfileIn( "main-action" );
 if( $search = $wgRequest->getText( 'search' ) ) {
        require_once( 'SearchEngine.php' );
        $wgTitle = Title::makeTitle( NS_SPECIAL, "Search" );
@@ -179,20 +180,25 @@ if( $search = $wgRequest->getText( 'search' ) ) {
                        $wgOut->errorpage( "nosuchaction", "nosuchactiontext" );
        }
 }
+wfProfileOut( "main-action" );
 
 # Deferred updates aren't really deferred anymore. It's important to report errors to the
 # user, and that means doing this before OutputPage::output(). Note that for page saves,
 # the client will wait until the script exits anyway before following the redirect.
+wfProfileIn( "main-updates" );
 foreach ( $wgDeferredUpdateList as $up ) {
        $up->doUpdate();
 }
+wfProfileOut( "main-updates" );
 
+wfProfileIn( "main-cleanup" );
 $wgLoadBalancer->saveMasterPos();
 
 # Now commit any transactions, so that unreported errors after output() don't roll back the whole thing
 $wgLoadBalancer->commitAll();
 
 $wgOut->output();
+wfProfileOut( "main-cleanup" );
 
 logProfilingData();
 $wgLoadBalancer->closeAll();
index 8b86bd0..698efce 100644 (file)
@@ -61,18 +61,22 @@ class LanguageUtf8 extends Language {
                # all strtolower on stripped output or argument
                # should be removed and all stripForSearch
                # methods adjusted to that.
+               
+               wfProfileIn( "LanguageUtf8::stripForSearch" );
                if( function_exists( 'mb_strtolower' ) ) {
-                       return preg_replace(
+                       $out = preg_replace(
                                "/([\\xc0-\\xff][\\x80-\\xbf]*)/e",
                                "'U8' . bin2hex( \"$1\" )",
                                mb_strtolower( $string ) );
                } else {
                        global $wikiLowerChars;
-                       return preg_replace(
+                       $out = preg_replace(
                                "/([\\xc0-\\xff][\\x80-\\xbf]*)/e",
                                "'U8' . bin2hex( strtr( \"\$1\", \$wikiLowerChars ) )",
                                $string );
                }
+               wfProfileOut( "LanguageUtf8::stripForSearch" );
+               return $out;
        }
 
        function fallback8bitEncoding() {