Profiling for Language::fetchLanguageNames
authorTim Starling <tstarling@wikimedia.org>
Tue, 23 Sep 2014 03:54:34 +0000 (13:54 +1000)
committerAnomie <bjorsch@wikimedia.org>
Wed, 24 Sep 2014 16:02:53 +0000 (16:02 +0000)
It is 16% of an enwiki Main Page parser cache hit, under HHVM.

Change-Id: Ifb2ce7592fa5b5cb9c7fb5af5949c43fecf18ca3

languages/Language.php

index 115a918..c889417 100644 (file)
@@ -849,6 +849,8 @@ class Language {
                global $wgExtraLanguageNames;
                static $coreLanguageNames;
 
+               wfProfileIn( __METHOD__ );
+
                if ( $coreLanguageNames === null ) {
                        global $IP;
                        include "$IP/languages/Names.php";
@@ -876,6 +878,7 @@ class Language {
                }
 
                if ( $include === 'all' ) {
+                       wfProfileOut( __METHOD__ );
                        return $names;
                }
 
@@ -897,10 +900,12 @@ class Language {
                                }
                        }
 
+                       wfProfileOut( __METHOD__ );
                        return $namesMwFile;
                }
 
                # 'mw' option; default if it's not one of the other two options (all/mwfile)
+               wfProfileOut( __METHOD__ );
                return $returnMw;
        }