Web browser: ---
            Bug ID: 61045
           Summary: Category->getName and Categry->getID hit DB even if
                    they already have the requested info
           Product: MediaWiki
           Version: unspecified
          Hardware: All
                OS: All
            Status: NEW
          Severity: normal
          Priority: Unprioritized
         Component: Categories
    Classification: Unclassified
   Mobile Platform: ---

getName and getID use a generic function getX.  That checks if the overall
instance is initialized (doing so if it wasn't).  Then it returns the requested

However, this is inefficient, since in some cases it already has that info.

For example, if you do:

$c = Category::newFromName( $catName );
$canonicalizedCatName = $c->getName()

it will hit the DB even though it already has the canonical name.

It should be lazy, and only hit it if it doesn't have the required info.

You are receiving this mail because:
You are the assignee for the bug.
You are on the CC list for the bug.
Wikibugs-l mailing list

Reply via email to