[TYPO3-ect] The Big Plan
JoH
info at cybercraft.de
Wed Jul 5 23:49:47 CEST 2006
> - I think 5 files per extension is rather small I give 8.
> - BUT if there a 10 extensions on a page 8 of them should be USER,
> only 2 can be USER_INT of you do a clean setup.
> - On the other hand even for unclean setups, libraries files are
> require_once. For 10 dynamic extensions on a page, common libraries
> will give big advantages and still limit the amount of fiels
>
> I would allow you 2 dynamic extensions, not more, each with 8 files to
> include. So my result is 16 files on pages with 10 extensions.
>
> If you are so crazy to use 5 USER_INT, I give you 5 files each
> (because of require once) => 20 files.
USER_INT will always be the bottleneck if you are using it many times on
just one page.
Recently I did some testing to speed up the rendering of pages containing
tt_products plugin with various parts (BASKET, LIST, MINIBASKET ...)
The major task was to optimize the way things are rendered from/into the
cache and only prevent those elements form caching that really need dynamic
output for each call and to get rid of set_no_cache().
I just used time() in the different functions to have an overview which
parts are dynamic and which come from the cached page.
The basic concept is having a TS-Setup like this:
plugin.tx_cachetest_pi1 = COA
plugin.tx_cachetest_pi1 {
10 = TEXT
10.data = date:U
10.strftime = %D - %H:%M:%S
10.wrap = First call: |<br /><br />
20 = USER
20 {
userFunc = tx_cachetest_pi1->main
userFunc {
basket = COA_INT
basket {
wrap = <hr />|
10 = TEXT
10.value = Basket (COA_INT):
20 = USER
20.userFunc = tx_cachetest_pi1->callTimeBasket
}
singleView = COA
singleView {
wrap = <hr />|
10 = TEXT
10.value = Single View (COA):
20 = USER
20.userFunc = tx_cachetest_pi1->callTimeSingle
}
combinedView = COA
combinedView {
wrap = <hr />|
10 = COA
10 {
wrap = |<br />
10 = TEXT
10.value = CombinedView (COA) Part1 (COA):
20 = USER
20.userFunc = tx_cachetest_pi1->callTimeCombined1
}
20 = COA_INT
20 {
wrap = |<br />
10 = TEXT
10.value = CombinedView (COA) Part2 (COA_INT):
20 = USER
20.userFunc = tx_cachetest_pi1->callTimeCombined2
}
}
}
}
}
As you can see, the functions are always called by a USER object, while the
caching is triggered using COA or COA_INT.
Since the whole setup is handed over to just one function inside the main
USER element, you can use $this->cObj->cObjGetSingle to render the different
parts according to the flexform-/codefield-setup of the plugin.
This way you can break down the whole layout into smaller chunks and render
only the relevant parts dynamically, while including the class only once.
You can see the result here:
http://www.4any1.de/index.php?id=2346&no_cache=1
http://www.4any1.de/index.php?id=2346
Using the adminPanel the difference between the cached and non cached
version is around 100ms (just for calling time() + TEXT element + wrap)
You can imagine the difference for more complex function calls and/or
TS-Setups.
AFAIK Franz Holzinger has already implemented the concept into the new
tt_products version, but I haven't found the time to test the results yet.
Maybe it could be the way to go to have an intelligent combination of TS and
PHP functions to optimize the way extensions are rendering their output.
Joey
--
Wenn man keine Ahnung hat: Einfach mal Fresse halten!
(If you have no clues: simply shut your knob sometimes!)
Dieter Nuhr, German comedian
openBC: http://www.cybercraft.de
More information about the TYPO3-team-extension-coordination
mailing list