Jump to content

Poor performance issues, FO only?


Recommended Posts

Hi,

The module "blockcategories" need a fix, you can reduce the maximum depth to increase the performance.
As for the back end, I've an average 0.075ms on my personnal computer, and 0.125ms for the product edition. Since my computer is an old, cheap one (ok not so old), I think your hosting company need to do some shopping :P

Overall performance is a little improved with the 1.1.

Link to comment
Share on other sites

  • 1 month later...
  • 1 year later...

I know this is an old thread, but it's still relevant.

I have a setup with more than 800 categories and sub-categories. The load time was more than 20 seconds on my (slow) server. I discovered that it was blockcategories that used most of the time.

The module blockcategories makes heavily use of smarty and recursively includes the tpl tree file. This is a bad idea performance wise.

I have rewritten the tree handling so it's done in PHP instead. This improved the performance significantly (less than 0.1 second on my server now).

I have attached my module.

/Kjeld

blockcategories.zip

  • Like 1
Link to comment
Share on other sites

presta-dyr - thanx for this!

I have another issue and the fix:

When u have many categories mixed with products, when u change product category on BO then load time is like 20-30 secs (on tested shop).
They fixed it in presta 1.3 and you can use classes/AdminTab.php from 1.3 in version 1.2.5. We tested it, and all works fine.

Link to comment
Share on other sites

  • 2 weeks later...

Hi presta-dyr,

I used the file you uploaded to help with the shop loading speed but did not notice any difference. If I want to revert back to the original blockcategories can I just delete the folder and replace it with the original?

Cheers

Link to comment
Share on other sites

  • 1 month later...
I know this is an old thread, but it's still relevant.

I have a setup with more than 800 categories and sub-categories. The load time was more than 20 seconds on my (slow) server. I discovered that it was blockcategories that used most of the time.

The module blockcategories makes heavily use of smarty and recursively includes the tpl tree file. This is a bad idea performance wise.

I have rewritten the tree handling so it's done in PHP instead. This improved the performance significantly (less than 0.1 second on my server now).

I have attached my module.

/Kjeld


Does this relate to the latest 1.3x versions?

Thanks :-)
Link to comment
Share on other sites

No, the performance of the category module and other areas has been improved in Prestashop v1.3. We'll need to re-evaluate the performance when v1.3 final is released and see what performance issues remain.

EDIT: Turns out that the performance of the category module hasn't been improved in PrestaShop v1.3.

Link to comment
Share on other sites

  • 4 weeks later...

When i import firs and second csv file with categories and subcategories (about 2000) it works ok, but when i import the third csv file with subsubcategories, the shop is very slow. Now i tryed to import subsubcategories in www.7parts.lt and get error :Internal Server Error
The server encountered an internal error or misconfiguration and was unable to complete your request.

Please contact the server administrator, [email protected] and inform them of the time the error occurred, and anything you might have done that may have caused the error.

More information about this error may be available in the server error log.


I call to my hosting administrator and he said that the probably the problem is with prestashop. Now there are no products in my shop and it's still slow. Is there any way to make prestashop faster? :(


Now i delet all subsubcategories and shop loads in 1,6 seconds. with subsubcategories it loads in 14 secons. so the reason is categorie block? any ideas?

Link to comment
Share on other sites

I wonder the same thing. I had a closer look at the site and all the categories are loaded in the top menu and not by AJAX like my category module. Also, the website has lots of modules installed, which may contribute to the slow loading time. I don't think it is my module that is causing the slow loading.

Link to comment
Share on other sites

Can this module really make shop faster? http://www.blossomcart.com/ use this module and loaiding time of this shop is about 45 seconds. Can somebody explain this?


The reason my site is slow has nothing to do with Rocky's module. His module is great. When I frist set up my site, I was learning programming. My codes works but were not clean. There were a lot of unneccsiary codes, therefore they slow dowm my site. I am in the middle of upgrading my site to 1.3 as well as cleaning up my codes.
Link to comment
Share on other sites

  • 2 months later...
I know this is an old thread, but it's still relevant.

I have a setup with more than 800 categories and sub-categories. The load time was more than 20 seconds on my (slow) server. I discovered that it was blockcategories that used most of the time.

The module blockcategories makes heavily use of smarty and recursively includes the tpl tree file. This is a bad idea performance wise.

I have rewritten the tree handling so it's done in PHP instead. This improved the performance significantly (less than 0.1 second on my server now).

I have attached my module.

/Kjeld


Very Nice

I`m using 1.3.1
It took the loading speed from ~6 sec down to 0,5 sec.
Link to comment
Share on other sites

  • 2 months later...

testing out Kjeld's blockcategories module. I tried replacing the standard 1.3.2 module with this one (deleted original through FTP and replaced with the new one) but now my categories don't show up at all. Do I have to actually uninstall and reinstall the new module for it to work or is just not working for 1.3.2?

thanks!

Link to comment
Share on other sites

  • 1 month later...

Hi

bit new to here but I have worked on most Open Source carts I have 2k of Cats/subcats and over 40k of products to fit in to cats I have tested a lot and have now moved on to presta to test.

this php script will import cats for you, its only quick made and will do one cat level at a time then after first is done you need the ids to link sub cats and so on.

Imports a csv file.

<?php
$hostname='localhost';
$username='USERNAME';
$password='PASWORD';
$database='DB NAME';
$filename='../import/import.csv';
$link = mysql_connect($hostname,$username,$password);
if (!$link) {
   die('Could not connect: ' . mysql_error());
}
echo 'Connected successfully to server.';
mysql_select_db($database);

if(!file_exists($filename)){
   die("\n".'file not found\.');
}

$handle = fopen($filename, "r");
$row=0;
echo "\n";
while (($catagory = fgetcsv($handle, 10000 ,",")) !== FALSE) {

   print(''); print_r($catagory); 
   print('
');

   if(count($catagory)!=3){
       echo "\n".'skipping line: '.$catagory;
   }
   $now=date("Y-m-d H:i:s");
   list($name,$id_parent,$link_rewrite)=$catagory;

   // Insert category
   $result = mysql_query(    'INSERT INTO    `category`(    `id_parent`,
                                                       `level_depth`,
                                                       `active`,
                                                       `date_add`,
                                                       `date_upd`
                                           ) 
                                           VALUES(        '.$id_parent.',
                                                       1,
                                                       1,
                                                       \''.$now.'\',
                                                       \''.$now.'\'
                                           )
                           ');
                               if(!$result) {
       echo '
'.mysql_error().'
';
       break;
   }
   $thisid = mysql_insert_id();
   echo 'Record Inserted: Auto ID is '.$thisid.'
'."\n";

   // Insert category group
   $result = mysql_query(    'INSERT INTO    `category_group`(`id_category`,
                                                           `id_group`
                                           )
                                           VALUES(            '.$thisid.',
                                                           1
                                           )
                           ');

   if(!$result) {
       echo '
'.mysql_error().'
';
       break;
       if(!mysql_query('DELETE FROM `category` WHERE `id_category` = '.$thisid.' LIMIT 1')) {
           echo '
Unable to cleanup dirty records: '. mysql_error() .'
';
       }
   }

   //Insert category language
   $result = mysql_query('INSERT INTO    `category_lang`(`id_category`,
                                                       `id_lang`,
                                                       `name`,
                                                       `link_rewrite`
                                       )
                                       VALUES(            '.$thisid.',
                                                       1,
                                                       \''.htmlspecialchars($name).'\',
                                                       \''.$link_rewrite.'\'
                                       )
                           ');

   if(!$result) {
       echo '
'.mysql_error().'
';
       break;
       if(!mysql_query('DELETE FROM `category` WHERE `id_category` = '.$thisid.' LIMIT 1')) {
           echo '
Unable to cleanup dirty records: '. mysql_error() .'
';
       }
       if(!mysql_query('DELETE FROM `category_group` WHERE `id_category` = '.$thisid.' LIMIT 1')) {
           echo '
Unable to cleanup dirty records: '. mysql_error() .'
';
       }
   }
}

echo '

Import done';
fclose($handle);
mysql_close($link);
?>




I really don't like all this Charging for simply scripts as the kind people made a free Cart and people try to make money off this and I personal think this is wrong.

I will be writing a new script for Product import but I have only just started on the DB.

If Presta can not handle all the prods then I will be moving on again.

Link to comment
Share on other sites

  • 6 months later...
  • 4 weeks later...
×
×
  • Create New...