To speed up…

This topic has been marked as not resolved.

Hello,

We are running OpenCart 1.5.5.1 and Shoppica 2.2.2 on IIS 8 with a very strong hardware. We are getting good performance with more than 30.000 products and 4.500 categories. We ofcourse have a heavily modified DB and code :)

We realized that there is still room for performance improvements.

Here is what we do now:
-We use the top menu for information pages only.
-We use the left category menu to display the top categories only.

What we realized is, generateCategoriesFlatTree function is being called more than 800 times which takes 7 seconds. The function recursively walks through most of the categories, which we don’t need in out setup.

What we need is the Top Categories for the left category menu and sub categories of the current category for the “Refine Search” part…

Is it possible for you to modify the required parts of the code for us? It is possible to reduce the time it takes to load the pages from 7 seconds to 2 seconds…

Best Regards…

March 30, 2013 at 4:28 am #21237

Why don’t you try to limit the recursion level of the function. Indeed it generates the category tree recursively, but you can modify the way it is called from

    public function buildCategoriesTree()
    {
        return $this->generateCategoriesTree($this->getAllCategoriesGroupedByParent());
    }

Try to change it to:

return $this->generateCategoriesTree($this->getAllCategoriesGroupedByParent(), true, array(), 1);

Does this help you ?

April 2, 2013 at 11:02 am #21360

Hi,
Thank you for your reply.

Here is what I did before your reply:

I modified SubCategoriesPlugin.php as follows…


//$category_from_tree = $this->getModel('category')->getCategoryFromFlatTree($category['category_id']);
            
$category['description'] = html_entity_decode($category['description'], ENT_QUOTES, 'UTF-8');
$category['path']  = $path . '_' . $category['category_id'];
$category['url'] =  $this->registry->get('url')->link('product/category', 'path=' . $category['path']);

Now, the Category Pages respond in 1 second.

What do you think?

Best Regards

April 3, 2013 at 1:30 am #21407

Was this the only change you made in order to speed up the category page ?

April 3, 2013 at 8:48 am #21411

We added lots of indexes and removed all product codes too :)

April 4, 2013 at 6:02 pm #21557
Viewing 5 posts - 1 through 5 (of 5 total)
  • You must be logged in to reply to this topic.