Loading categorie list tree takes a lot of time

Started by sandomatyas, July 06, 2020, 17:28:08 PM

Previous topic - Next topic

sandomatyas

There is a site with ~15.000 categories. As far as I can see VM uses huge amout of database queries when loads the tree recursively and it takes time, ~20-30 secs when it's not in the cache. Could you please consider optimizing this part of the code?

pinochico

very bad idea,

maybe you don't know about psychology of custmer's on eshop, if you want show tree of 15000 categories.

Eshop is not created for developer, but for customer's and must be higly bussines.
If not, is only for fun :)
www.minijoomla.org  - new portal for Joomla!, Virtuemart and other extensions
XML Easy Feeder - feeds for FB, GMC,.. from products, categories, orders, users, articles, acymailing subscribers and database table
Virtuemart Email Manager - customs email templates
Import products for Virtuemart - from CSV and XML
Rich Snippets - Google Structured Data
VirtueMart Products Extended - Slider with products, show Others bought, Products by CF ID and others filtering products

sandomatyas

I know it is not optimal, I was not who built the site, but it is there, it was working before VM 3.8

BTW I had a quite similar issue with a non-Joomla site, there was a kind of parent-child tree solution assigned to the items which is quite similar how VM handles categories. When I worked with this, it took more than a minute to build the parent-child tree with a recursive function and a query in every loop. If I'm right this is how VM handles this. I refactored the code, fetched the tree elements with a single sql query and built the tree with a recursive function but without internal queries, there was only array/object handling with php scripts. I got the same result as above but in less than 2 seconds.
So maybe it does worth some effort do build more scalable code :)

pinochico

www.minijoomla.org  - new portal for Joomla!, Virtuemart and other extensions
XML Easy Feeder - feeds for FB, GMC,.. from products, categories, orders, users, articles, acymailing subscribers and database table
Virtuemart Email Manager - customs email templates
Import products for Virtuemart - from CSV and XML
Rich Snippets - Google Structured Data
VirtueMart Products Extended - Slider with products, show Others bought, Products by CF ID and others filtering products

sandomatyas

Should I open a new topic or is it possible to move it there?