[Typo3-dev] Higher parsetime in 3.8.0
Simon Ihmig
ihmig at kaliber5.de
Fri Aug 26 16:56:56 CEST 2005
Simon Ihmig schrieb:
> I am still trying to find out why I have a considerable overhead by
> using an empty USER_INT. I will let you guys know when I find something
> out...
ok, so here we go...
I digged a little bit into t3 source code and profiled some functions
with $TT->push/pull.
There are two entries in the TypoScript admin panel output that show
larger parsetimes when using an empty USER_INT, "/Parse template" and
"/Page generation".
First to "/Page generation":
The time is spent in tslib/index_ts.php for including
class.tslib_pagegen.php (which includes a whole lot of other classes)
and executing pagegen.php. This is obviously necessary because the
dynamically executed USER_INT needs the TYPO3 APIs, so no way to
circumvent this.
By using a php accelerator, the spent time is decreased to nearly zero,
so not a big issue here. Just be sure to use a php accelerator.
To "/Parse template":
Within this section the function t3lib_TStemplate->start() is called by
tslib_fe->getConfigArray(). It builds the TS array, which is obviously
also needed by the USER_INT, however caching should allow for low overhead.
Profiling revealed that most of the time is consumed by the following parts:
A: invoke runThroughTemplates() - took 33ms
B: invoke getHash() - took 7ms
C: unserialize the cached TS - took 12ms
D: cache_pagesection is written - took 3ms
The mentioned parsetimes are based on a rather complex site, with a lot
of extension etc., so maybe C can be optimized by simplifying the TS
code like Joey suggested.
This might be untrue as I am not so involved into the T3 core, but I
feel that A might be a real design flaw.
When you look at runThroughTemplates() it seems to look for templates in
the rootline, and calls processTemplate() for every template found,
which recursively calls itself for other templates that are beeing included.
So basically it fetches all the used templates from the database. And if
you have splitted up a complex website into many templates, for the sake
of readability and reusability, which is a good thing to do IMHO (!),
this might lead to some 20 database calls or so!
So the question goes to some T3 insider: is there any need for this
whole process? I see that the actual TS code is fetched later from
cache, but there are still those many database operations before by
calling runThroughTemplates().
If that call makes sense in the current implementation, wouldn't it be
possible to also use some caching mechanism?
The TS code stays the same for every page view, so there shouldn't be a
need for this, should it?
Though 33ms might sound very little, when you are able to eleminate this
and thus reduce parsetimes from 90ms to 60ms, you can actually serve 50%
more traffic. For a highvolume site that's a huge performance increase!
Greetings,
Simon
More information about the TYPO3-dev
mailing list