Page 1 of 2

performance issue while edit category

Posted: 27 Oct 2008, 22:17
by hmayer1980
Hi,

since my last bulk add of pictures I cannot edit a category anymore because the hoster kills scripts with that long runtime (>= 30sec. CPU Time).
Before the last import it worked slow but it worked - and it decreased performance over time.
The last add of pictures increased them from 9500 to 10600 pictures.

Is there any loop throgh the pictures in the edit categorie admin interface? (I want to rename the categorie, change the description and so on - hast nothing to do with pictures count)
The categories Count increased from 190 to aprox. 220 .

By the way - the tumbnails are all generated. It works well with the pagination.

What could I do?
I use 2.0.2.

(could you give me an hint where to look at to debug myself?)

Hannes

by the way: great job so far - just a view more fixes to make the gallery a full scale extension to joomla.

Re: performance issue while edit category

Posted: 27 Oct 2008, 23:04
by Jan
Hi, if there are a lot of images there is a pagination thumbnail creation...

but in edit category, there is a select box of categories (this can slow the system) because all categories are displayed in the select box (there is a checking if the category can be displayed in the select box or not) ... but with 220 categories it should work ???

BTW: the categories tree displaying in edit category is waiting for the optimalization (maybe it will help, maybe not )

Jan

Re: performance issue while edit category

Posted: 28 Oct 2008, 22:04
by hmayer1980
Hi,

i have disabled the thumbnail creation and it is still really slow and sometimes killed. IF I create a new category it is really fast (< one second). So it could not be the dropdown with all the categories.

could you give me an hint where the code is located to manually review?

What kind of checking is done in the admin interaface for the categories?
Is the same checking done if I create a new category? then it could not be this part.

Maybe the ordering - but this dropdown is even smaller with just 120 options in the select list.

Hannes

Re: performance issue while edit category

Posted: 29 Oct 2008, 01:05
by Jan
Hi,

categories:

view:
administrator/components/com_phocagallery/phocagalleryc (displaying of edit or new)
administrator/components/com_phocagallery/phocagallerycs (list of categories)

model:
administrator/components/com_phocagallery/models/phocagalleryc.php
controller
administrator/components/com_phocagallery/controllers/phocagalleryc.php

helper:
administrator/components/com_phocagallery/helpers/phocagallery.php

Jan

Re: performance issue while edit category

Posted: 02 Nov 2008, 01:16
by hmayer1980
Hello,

I have done some debugging and the performance issue is for sure in the function.

PhocaGalleryHelper::CategoryTreeCreating

I have uploaded some more pictures - and now with 295 Categories I cannot edit them because every edit call is taking more then 30 Seconds CPU Time.

I had a quick view at the code and I did not understand that 4 nested foreach loops - is there anything which could be deactivated without major issues? Or any other hint how to make it work right now?

If I comment out the following lines in the phocagalleryc view (beginning Line 130) I miss the category tree, but the performance is normal.

Code: Select all

                $tree = PhocaGalleryHelper::CategoryTree($phocagallerys, $tree, 0, $text);


                $phocagallerys_tree_array = PhocaGalleryHelper::CategoryTreeCreating($phocagallerys, $tree, $phocagallery->id);

                array_unshift($phocagallerys_tree_array, JHTML::_('select.option', '0', '- '.JText::_('Select Parent Category').' -', 'value', 'text'));

                //list categories
                $lists['parentid'] = JHTML::_( 'select.genericlist', $phocagallerys_tree_array, 'parentid',  '', 'value', 'text', $phocagallery->parent_id);

I do not understand why this is not called for creating a new Cateogory, or at least I did not get It right know. (Could not be the same done at edit then for new?)

What is your schedule for the optimization you already mentioned?

Hannes

(Now that I know what to look for it seems I am not the only one - I guess this posts are the same
viewtopic.php?f=1&t=2047
viewtopic.php?p=8884#p8884
)

Re: performance issue while edit category

Posted: 02 Nov 2008, 21:15
by Jan
Yes, I am workinng now on the optimization of this code, there were problem with displaying and checking if the parent category cannot be sub category. I don't know the problem know because I have done it one year ago but I think, there were some problems with php4 (value was not added into the object, so there are the foreach loops) I hope I will optimize this part...

Jan

Re: performance issue while edit category

Posted: 03 Nov 2008, 01:21
by Jan
I have optimized it, now I am testing it on my server, maybe tommorrow I will release 2.1.0 beta 2

Jan

Re: performance issue while edit category

Posted: 03 Nov 2008, 15:22
by Jan
Try to upgrade to Phoca Gallery version 2.1.0 RC, there the loading time of category tree should be reduced to minimum while editing the category in administration.

Please let me know if it works.

Jan

Re: performance issue while edit category

Posted: 04 Nov 2008, 02:53
by bornakke
Installing 2.1.0 gives me an error in line 16:

Warning: require_once(/home/www/tipoff.dk/administrator/components/com_phocagallery/helpers/phocalibrary.php) [function.require-once]: failed to open stream: No such file or directory in /home/www/tipoff.dk/modules/mod_phocagallery_random_image/mod_phocagallery_random_image.php on line 16

Fatal error: require_once() [function.require]: Failed opening required '/home/www/tipoff.dk/administrator/components/com_phocagallery/helpers/phocalibrary.php' (include_path='.:/usr/share/php:/usr/share/pear') in /home/www/tipoff.dk/modules/mod_phocagallery_random_image/mod_phocagallery_random_image.php on line 16

Re: performance issue while edit category

Posted: 04 Nov 2008, 12:08
by Jan
Installing 2.1.0 gives me an error in line 16
Do you mean installing Phoca Gallery Random Image Module? Do you have the latest 2.1.0 RC version of Phoca Gallery Component ?

Jan