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 info.
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.
Version: 1.23.0
Severity: normal