twhite3000 / vqmod

Automatically exported from code.google.com/p/vqmod
0 stars 0 forks source link

VQMod:_checkMatch too many calls (16848 ) => extra 500 miliseconds function cost for single page #63

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. Opencart with 30 xml files 4kb (someones 30kb)
2.
3.

What is the expected output? What do you see instead?
 Slow response time
vQmod Version:2.2.1 Opencart Version
Server Operating System: LAMP on Ubuntu 12.04.1 LTS small dev server (dualCore 
2GB)

Please provide any additional information below.

 Profiler indicates  VQMod:_checkMatch gets 16848 Calls with a total time of 0'453 seconds!!! cost added for only this function!!.

 In Deploy would be interesting to disable checks, prebuild all modded files in cache single time and only check if is modded or not (also remove cache time life)

Greetings & Thanks for your job

Original issue reported on code.google.com by i...@babitsch.es on 5 Dec 2012 at 1:48

Attachments:

GoogleCodeExporter commented 9 years ago
Oddly enough this slowness isn't down to files that are modified, but actually 
files that aren't. All of the files that are modified don't go through this 
process more than once per edit of files/addition or removal of mods. However 
since the files that aren't modded aren't cached, there are constantly checks 
to make sure that those files don't have operations. It's also difficult to 
capture all of the files that are to be skipped too since not all of them get 
loaded on a page. As for the suggestion of the prebuild...that would be fine if 
it weren't for the wildcard file names. I've changed the status of this to 
"Accepted" however there's no guarantee this will be worked on soon and that 
there will be a solution to this

Also, would you mind sharing the application you used to do the profiling of 
the code

Original comment by DJG6...@gmail.com on 6 Dec 2012 at 10:39

GoogleCodeExporter commented 9 years ago
Thanks for the reply, a quick and dirty temporal patch could be something like 
this:

Line 104 of vqmod.php, after
if(isset($this->_filesModded[$sourcePath])) {
 return $this->_filesModded[$sourcePath]['cached'] ? $cacheFile : $sourceFile;
}
adding:
 if ( $im_sure_all_mods_are_applied_and_cached )
    return $sourcePath;

I used Zend Studio profiler, http://www.zend.com/en/products/studio/downloads
an opensource alternative could be http://code.google.com/p/webgrind/

Greetings 

Original comment by i...@babitsch.es on 6 Dec 2012 at 11:05

GoogleCodeExporter commented 9 years ago
Fixed in next version

Original comment by DJG6...@gmail.com on 25 Jan 2013 at 12:33