Category Module Helper Performance Issue
Hi guys,
We’ve run into a performance issue with the VM category module override.
On a site with around 500 categories and 20.000 products, even on a very fast server, this part alone takes about 10–15 seconds to execute on the first load. After some debugging, it looks like most of the time is spent inside this helper file when building the category tree and product lists: plugins/system/vmuikitx_override/html_override/mod_virtuemart_category/helpers.php
When temporarily disabling this override, the page load time drops back to normal.
So it seems the category/product aggregation logic in the helper doesn’t scale very well with larger category trees.
Although Joomla’s cache helps to some extent, it gets cleared relatively often, and the performance hit is quite noticeable — customers have already reported slow page loads.
Is there a way to optimize how the product counts are calculated in this helper, especially for larger category trees?
Environment: Joomla 5 + VirtueMart 4.6.4
Thank you in advance
We’ve run into a performance issue with the VM category module override.
On a site with around 500 categories and 20.000 products, even on a very fast server, this part alone takes about 10–15 seconds to execute on the first load. After some debugging, it looks like most of the time is spent inside this helper file when building the category tree and product lists: plugins/system/vmuikitx_override/html_override/mod_virtuemart_category/helpers.php
When temporarily disabling this override, the page load time drops back to normal.
So it seems the category/product aggregation logic in the helper doesn’t scale very well with larger category trees.
Although Joomla’s cache helps to some extent, it gets cleared relatively often, and the performance hit is quite noticeable — customers have already reported slow page loads.
Is there a way to optimize how the product counts are calculated in this helper, especially for larger category trees?
Environment: Joomla 5 + VirtueMart 4.6.4
Thank you in advance
by keep2000
Please Log in or Create an account to join the conversation.
- JProStudio
-
Away
- Admin
-
- Posts: 536
- Thank you received: 80
Replied by JProStudio on topic Category Module Helper Performance Issue
Posted 7 months 3 weeks ago #1052
We have a limited testing environment to debug a scenario like this so kindly share the site credentials for trouble shooting the actual issue. Thank you
For urgent help please create a support ticket extensions.joomlapro.com/support/tickets
by JProStudio
Please Log in or Create an account to join the conversation.
- JProStudio
-
Away
- Admin
-
- Posts: 536
- Thank you received: 80
Replied by JProStudio on topic Category Module Helper Performance Issue
Posted 7 months 3 weeks ago #1055
We’ve modified the multiple SQL calls used to build the category tree (child categories). I’ve attached the updated
—please review the file and confirm the results at your end.Note: It’s recommended not to use this in the production environment before thorough testing. Thank you
Code:
helpers file
For urgent help please create a support ticket extensions.joomlapro.com/support/tickets
Last Edit:7 months 3 weeks ago
by JProStudio
Last edit: 7 months 3 weeks ago by JProStudio.
Please Log in or Create an account to join the conversation.
Replied by keep2000 on topic Category Module Helper Performance Issue
Posted 3 months 3 weeks ago #1184This message contains confidential information
by keep2000
Please Log in or Create an account to join the conversation.
Replied by keep2000 on topic Category Module Helper Performance Issue
Posted 2 months 2 weeks ago #1201
Hey guys,
Did you get a chance to check this?
Did you get a chance to check this?
by keep2000
Please Log in or Create an account to join the conversation.
- JProStudio
-
Away
- Admin
-
- Posts: 536
- Thank you received: 80
Replied by JProStudio on topic Category Module Helper Performance Issue
Posted 2 months 1 week ago #1202
Hi we will check this. thanks
For urgent help please create a support ticket extensions.joomlapro.com/support/tickets
by JProStudio
Please Log in or Create an account to join the conversation.
- JProStudio
-
Away
- Admin
-
- Posts: 536
- Thank you received: 80
Replied by JProStudio on topic Category Module Helper Performance Issue
Posted 1 month 3 weeks ago #1204
Hi,We updated the changes in the module, but there were some issues. Those issues are fixed now.Can you please check the attached file and let us know if everything is working fine on your site?Thanks.
For urgent help please create a support ticket extensions.joomlapro.com/support/tickets
by JProStudio
Please Log in or Create an account to join the conversation.
Replied by keep2000 on topic Category Module Helper Performance Issue
Posted 1 month 1 week ago #1209
Hi,
thanks for integrating the earlier helpers.php change (no sortSearchListQuery per category). That part looks good.
First uncached load of mod_virtuemart_category with the VMuikitX default layout was still 5–6 seconds here (557 published categories, seo_full=1). After module cache it was instant. Another instance of the same module with a custom flyout layout did not show this delay.
What we found: the layout calls JRoute for every category in the tree. With full SEF, VirtueMart getCategoryRoute() → getCategoryNames() → getCategory($id) for each id that is not already in vmrouterHelper::$CategoryName. On cache miss that is a full category table load (+ media) per category — hundreds of extra loads on a shop this size.
The helper already has slug and category_parent_id from one getChildCategoryListObject() call.
What worked for us: after loading all categories, we built the parent/child slug paths in memory and prefilled vmrouterHelper::$CategoryName[$lang][$id]. After that, first load was fast. We also attached the prebuilt /menu-alias/parent/child URL on the category objects, but the $CategoryName warmup was the important part.
thanks for integrating the earlier helpers.php change (no sortSearchListQuery per category). That part looks good.
First uncached load of mod_virtuemart_category with the VMuikitX default layout was still 5–6 seconds here (557 published categories, seo_full=1). After module cache it was instant. Another instance of the same module with a custom flyout layout did not show this delay.
What we found: the layout calls JRoute for every category in the tree. With full SEF, VirtueMart getCategoryRoute() → getCategoryNames() → getCategory($id) for each id that is not already in vmrouterHelper::$CategoryName. On cache miss that is a full category table load (+ media) per category — hundreds of extra loads on a shop this size.
The helper already has slug and category_parent_id from one getChildCategoryListObject() call.
What worked for us: after loading all categories, we built the parent/child slug paths in memory and prefilled vmrouterHelper::$CategoryName[$lang][$id]. After that, first load was fast. We also attached the prebuilt /menu-alias/parent/child URL on the category objects, but the $CategoryName warmup was the important part.
by keep2000
Please Log in or Create an account to join the conversation.
Time to create page: 0.354 seconds