News:

You may pay someone to create your store, or you visit our seminar and become a professional yourself with the silver certification

Main Menu

Major performance hit when using customfields and plugins

Started by Stephen Roberts, November 22, 2011, 17:38:08 PM

Previous topic - Next topic

Stephen Roberts

I have 5 normal custom fields and 2 custom field plugins on each product. I'm calling getProducts() from the product model with a list of about 50 virtuemart_product_ids to retrieve. This function is taking 10-20 seconds to load the products. I traced the problem down to vmcustomplugin's setClass() method. I didn't see anything obvious that would cause such a performance hit other than loading 100 new plugins on the page in my case.

In my case, I don't need the plugins to be loading on the front end like that. One solution would be to create an extra parameter in getProducts() to specify whether to get customplugins or not. Of course this parameter would also have to be added to getProductSingle() and the customfields model getProductCustomsField(). Anyone have any thoughts or suggestions on this?

I hate to have to override another model, but I just can't afford performance issues like this.
Sell downloadable (virtual) products in VirtueMart 2 and deliver downloads via local server, Amazon S3, and more! http://www.digitollsoftware.com

Milbo

of course, thanks for showing it.
We already found some problems like that. my standard solution is to instantiate the plugins.
Should I fix your bug, please support the VirtueMart project and become a member
______________________________________
Extensions approved by the core team: http://extensions.virtuemart.net/

Cleanshooter

One thing I have done with my shop is convert some things I had set as custom fields to information that just gets put in the details.  I understand if you need them for check out (product size for example) or in other instances this will not work.  But if your custom field only contains static text information it will be faster if you just put it in the description. 
- Cleanshooter

Stephen Roberts

Thanks for the replies. Hopefully we'll see some improvement on this in upcoming releases. :)

Cleanshooter, unfortunately my plugins are quite complex. Thanks for the suggestion though!
Sell downloadable (virtual) products in VirtueMart 2 and deliver downloads via local server, Amazon S3, and more! http://www.digitollsoftware.com

Milbo

The optimised version has now following stats
vmdebug vmTime: VirtuemartControllerVirtuemart Finished time consumed 0.20846605300903
Application afterRender: 0.921 seconds, 10.61 MB
197 queries logged
for the normal sampel data

Before we had more than 800 queries and the vmTime was around 0.5 on my machine.
Should I fix your bug, please support the VirtueMart project and become a member
______________________________________
Extensions approved by the core team: http://extensions.virtuemart.net/

Stephen Roberts

Sell downloadable (virtual) products in VirtueMart 2 and deliver downloads via local server, Amazon S3, and more! http://www.digitollsoftware.com