Do you think it might be an improvement if both Title::getParentCategories
and Title::getParentCategoryTree could store their results in a local
variable? They currently fetch the resuts DB each time regardless of whether
they've been called already or not. I'm not sure how much this is called in
a normal installation, but we call it a few times to figure out the category
structure of the article.
Storing the results seems to cut down our # of db calls by about 12 per page