[TYPO3-mvc] Wondering about performance

Daniel Dimitrov danielsd_bg at yahoo.fr
Wed Apr 28 09:55:32 CEST 2010


Hey Felix,
Thanks for the fast reply!
I thought that lazy loading was the key here and I tried it.
I was confused with the result. Let us say that my description field has the 
@lazy tag in the comment.

In my controller I did this:
$products = $this->listRepository->findAllWithLimit($pages,10);
var_dump($products);

As you see I wrote my own query to fetch the results with limit.
In my var_dump output I was seeing the description variable and it was 
initialized - it had the values from the database.
I thought that lazy loading will set the description variable to 0 and first 
when I try to use it in my fluid template it will be loaded.
Did I understand the principal behind lazy loading wrong?

Regards,
Daniel

"Felix Oertel" <mehl at foertel.com> wrote in message 
news:mailman.1.1272441067.24081.typo3-project-typo3v4mvc at lists.typo3.org...
> Hey Daniel,
>
> Am 28.04.10 09:30, schrieb Daniel Dimitrov:
>> However in list view I must show just 5 fields and in single view I have
>> to show some 30 fields.
>> I'm using Tx_BwShop_Domain_Model_Products both in single and in list
>> view.
>
> You should annotate those values you don't use in list-view as 
> lazy-loading (@lazy). This makes the values are not fetched on load but on 
> first access ... in case of the list-view: never. ;-)
>
> Did you watch out for a propper LIMIT while fetching the products for 
> list-view? It would not make sense to load 10.000 products into ram just 
> to display the first 20 of them.
>
> If you have something like categories (for products you most likely have) 
> in an m:n-relation in your product and you do not have them annotated 
> lazy-loading, on loading extbase will resolve those relations and load all 
> the product-objects into the category-property. So it would be good to use 
> lazy-loading here as well.
>
> regards, foertel 



More information about the TYPO3-project-typo3v4mvc mailing list