Cart taking too long to calculate price (or it seems so)

Started by Greenhillz, August 26, 2015, 06:54:16 AM

Previous topic - Next topic

Greenhillz

Hi,

the cart on my local website takes about 300 ms to calculate the total price of the cart (even if it is empty).

$data=$plg->prepareAjaxData();   -> 300 ms*
- $this->_cart->prepareCartData(false); -> 292 ms
- - $calculator->getCheckoutPrices($this); -> 283 ms
- - - $this->calculateShipmentPrice(); -> 58 ms
- - - $this->calculatePaymentPrice(); -> 220 ms
- - - - $varsToPush = $this->getVarsToPush (); (standard.php) -> 47 ms

I was wondering : do you think the optimization of this lies elsewhere than in the code ? Maybe some misconfiguration ?
Because, obviously, the logical steps required to calculate the prices on my simple website wouldn't require so much time at all. Should i hire someone to simplify the virtuemart general code, or is there something else i could do ?

Greenhillz.



jenkinhill

Kelvyn
Lowestoft, Suffolk, UK

Retired from forum life November 2023

Please mention your VirtueMart, Joomla and PHP versions when asking a question in this forum

Greenhillz

Hi,

thanks for the reply and sorry for the lack of information, the timings are for the wamp version, but here is the website :

http://dosagile.fr/
VirtueMart 3.0.9.4
Host : OVH France
Joomla! 3.4.3

jenkinhill

Wamp is always far slower than a real optimised server, so any figures obtained with localhost are not worth considering.

Tha AJAX refresh of the cart page on the live site is a little on the slow side, but your template is packed with css & js files which probably have an impact on that. Try switching to the Protostar template to see how quick the cart is there.
Kelvyn
Lowestoft, Suffolk, UK

Retired from forum life November 2023

Please mention your VirtueMart, Joomla and PHP versions when asking a question in this forum

GJC Web Design

Agree .. I find WAMP and XAMP are always dog slow on even the fittest local PC compared to a good host server
GJC Web Design
VirtueMart and Joomla Developers - php developers https://www.gjcwebdesign.com
VM4 AusPost Shipping Plugin - e-go Shipping Plugin - VM4 Postcode Shipping Plugin - Radius Shipping Plugin - VM4 NZ Post Shipping Plugin - AusPost Estimator
Samport Payment Plugin - EcomMerchant Payment Plugin - ccBill payment Plugin
VM2 Product Lock Extension - VM2 Preconfig Adresses Extension - TaxCloud USA Taxes Plugin - Virtuemart  Product Review Component
https://extensions.joomla.org/profile/profile/details/67210
Contact for any VirtueMart or Joomla development & customisation

Greenhillz

Thanks a lot ! I didn't think that the template could be responsible, i thought the code "getcartprices" would only get the prices. I'm digging this way. And my Wamp is actually going faster because of the hardware difference.
(on protostar template, the cart style stays the same, and takes even more time to load, and bugs. ^^ This error must be human made though, i don't really know how to decently switch templates)