Community mailing list archives

[9.0C] website_sale_delivery - Seems To Slow Down Add To Cart Significantly

Luke Branch
- 01/05/2016 04:32:58

Has anyone else made much use of the website_sale_delivery with delivery grids?

I've found that the more delivery methods and delivery lines that are added the slower the add to cart on the website frontend is for logged in users.

For example i've got a set of delivery rates with:

>> 1 x rates table per country (i've got 50 countries added so far with an average of 60 lines per country with advanced pricing per destination)
*so 50 countries x 60 lines = 3000 lines total

>>  1 rates table per zone (i've got 3 zones with 200 lines each zone with advanced pricing per destination)
*so 3 zones x 200 lines = 600 lines total

If I add a product to the shopping cart it can take up to a minute on a machine on the local network with 4 cores and 4GB of RAM running PostgreSQL 9.5 and with only Odoo & PostgreSQL running on that machine.

It seems as if the website_sale_delivery module loops through every single line of every published delivery method, not taking into account whether that delivery method is for the country the logged in user has as their shipping address. 

This is only an assumption as I have not yet had time to dig into the code, however by unpublishing the 50 or so countries with the EMS shipping method mentioned above the problem is drastically improved (although still not great).

I'm wondering if I should I throw more RAM and CPU at the problem or whether there is an underlying issue with the way website_sale_delivery is handling this particular situation.