VirtueMart Forum

VirtueMart 2 + 3 => Security (https) / Performance / SEO, SEF, URLs => Topic started by: sandomatyas on July 06, 2020, 17:28:08 pm

Title: Loading categorie list tree takes a lot of time
Post by: sandomatyas on July 06, 2020, 17:28:08 pm
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?
Title: Re: Loading categorie list tree takes a lot of time
Post by: pinochico on July 06, 2020, 19:47:35 pm
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 :)
Title: Re: Loading categorie list tree takes a lot of time
Post by: sandomatyas on July 07, 2020, 11:22:35 am
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 :)
Title: Re: Loading categorie list tree takes a lot of time
Post by: pinochico on July 07, 2020, 11:39:40 am
This question is for VM DEV :)

Title: Re: Loading categorie list tree takes a lot of time
Post by: sandomatyas on July 07, 2020, 16:11:00 pm
Should I open a new topic or is it possible to move it there?