Variant performance improvement in 4.0
More results from my profiling work. It seems when X-Cart is displaying the product page it gets pricing for each of the variants for the product. One of the things that requires is looking up the tax rates for the product. No matter which variant you are talking about the tax rate is the same but X-Cart calls a function to find out for every variant anyway. In one lower level function they they tried to cache the result to speed it up but they goofed and it only works for logged in users. This mod fixes the low level caching to work for not logged in users and adds caching at a higher level function for even more improvement. The performance improvement naturally depends on the number of variants the product has. On my test box I'm seeing roughly 1/4 second for 40 variants. On my faster production server its a little more than 1/2 that. It makes a product page with a lot of variants about as fast as one with only a couple of variants.
This is for version 4.0.x. Looks like at least 4.0.12 through 4.0.19. I guess X-Cart must have done some profiling too as they have added the higher level caching in 4.1 which is where the big gain is. I don't think 4.1 users will find any noticeable improvement if they were to implement the lower level cache fix only. In func.php function func_get_customer_zones_avail find this: PHP Code:
PHP Code:
Then in func.php function func_get_product_tax_rates find: PHP Code:
And replace it with this: PHP Code:
|
Re: Variant performance improvement in 4.0
Interesting mod, ill definately check this one out as soon as i get the other mods installed :) Ill keep you updated.
|
Re: Variant performance improvement in 4.0
Just wondered if you have had a go with this yet???
|
Re: Variant performance improvement in 4.0
Thanks, this is working well on my 4.0.18 installation.
Jeanne 4.0.18 gold |
All times are GMT -8. The time now is 03:50 PM. |
Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.