Forums / All Other Contributions/Addons / Perfmon - A tool for finding performance bottlenecks

Perfmon - A tool for finding performance bottlenecks

Views: 3,571

Results 1 to 4 of 4
1 Jun 2013, 1:12 PM
#1
swguy avatar

swguy

Administrator

Join Date:
Feb 2006
Location:
Tampa Bay, Florida
Posts:
10,720
Plugin Contributions:
56

Perfmon - A tool for finding performance bottlenecks

Version 1.0 of Perfmon has just been released.

http://www.zen-cart.com/downloads.php?do=file&id=1670

Perfmon allows you to view the time when each notifier point is hit during a page load, and thus quickly isolate what could be slowing down your page loads.

That Software Guy. My Store: Zen Cart Support
Available for hire - See my ad in Services
Plugin Moderator, Documentation Curator, Chief Cook and Bottle-Washer.
Do you benefit from Zen Cart? Then please support the project.

2 Jun 2013, 8:22 AM
#2
torvista avatar

torvista

Totally Zenned

Join Date:
Aug 2007
Location:
Gijón, Asturias, Spain
Posts:
2,875
Plugin Contributions:
7

Re: Perfmon - A tool for finding performance bottlenecks

Looks useful, thanks.

I didn't like it creating debug/error files as they show up in my admin, so I changed the last line:

       //error_log($line);
       error_log($line."\n",3,DIR_FS_LOGS.'/perfmon.log');

I also changed the formatting a bit to line up the notifys (which does not display the same in the quote below)

//$separator = ",";  // Could be " " if csv not desired
        $separator = "\t\t";
       $currtime = microtime(true);
       if (isset($lasttime)) { 
          $timediff = (int)($currtime*10000) - (int)($lasttime*10000);
          if (strlen((string)$timediff)>=4) $separator = "\t"; 
  

So, now I have my list from a product page. The notifiers are not in a time-order which I find a bit surprising.
There seems to be some big numbers in there and indeed I feel the product pages load slowly.

So, from your experience, how would you go about investigating this?
Just find the notifier and work backwards?

0        NOTIFY_HEADER_START_PRODUCT_INFO
712        NOTIFY_HEADER_END_PRODUCT_INFO
249        NOTIFY_MODULE_START_META_TAGS
193        NOTIFY_MODULE_END_META_TAGS
3598    NOTIFIER_CART_COUNT_CONTENTS_START
128        NOTIFIER_CART_GET_QUANTITY_START
93        NOTIFIER_CART_GET_QUANTITY_END_QTY
93        NOTIFIER_CART_COUNT_CONTENTS_END
137        NOTIFIER_CART_COUNT_CONTENTS_START
99        NOTIFIER_CART_GET_QUANTITY_START
229        NOTIFIER_CART_GET_QUANTITY_END_QTY
105        NOTIFIER_CART_COUNT_CONTENTS_END
125        NOTIFIER_CART_SHOW_TOTAL_START
200        NOTIFIER_CART_SHOW_TOTAL_END
56524    PAGE_OUTPUT_IMAGE_SUBMIT
584        PAGE_OUTPUT_IMAGE_SUBMIT
623        PAGE_OUTPUT_IMAGE_SUBMIT
870        NOTIFY_HANDLE_IMAGE
2781    NOTIFY_MAIN_TEMPLATE_VARS_START_PRODUCT_INFO
308        NOTIFY_PRODUCT_VIEWS_HIT_INCREMENTOR
742        PAGE_OUTPUT_IMAGE_BUTTON
463        PAGE_OUTPUT_IMAGE_BUTTON
466        NOTIFY_HANDLE_IMAGE
374        NOTIFY_HANDLE_IMAGE
303        NOTIFY_PRODUCT_TYPE_VARS_START_PRODUCT_INFO
127        NOTIFY_PRODUCT_TYPE_VARS_END_PRODUCT_INFO
255        NOTIFY_MAIN_TEMPLATE_VARS_PRODUCT_TYPE_VARS_PRODUCT_INFO
1184    NOTIFY_MAIN_TEMPLATE_VARS_EXTRA_PRODUCT_INFO
1077    PAGE_OUTPUT_IMAGE_BUTTON
1004    NOTIFY_HANDLE_IMAGE
349        NOTIFY_HANDLE_IMAGE
332        NOTIFIER_CART_IN_CART_START
127        NOTIFIER_CART_IN_CART_END_FALSE
295        NOTIFIER_CART_GET_QUANTITY_START
139        NOTIFIER_CART_GET_QUANTITY_END_FALSE
214        PAGE_OUTPUT_IMAGE_SUBMIT
515        PAGE_OUTPUT_IMAGE_BUTTON
1678    NOTIFY_HANDLE_IMAGE
888        NOTIFY_HANDLE_IMAGE
1118    NOTIFY_HANDLE_IMAGE
572        NOTIFY_HANDLE_IMAGE
425        NOTIFY_HANDLE_IMAGE
353        NOTIFY_HANDLE_IMAGE
576        NOTIFY_HANDLE_IMAGE
403        NOTIFY_HANDLE_IMAGE
674        NOTIFY_HANDLE_IMAGE
3801    NOTIFY_HANDLE_IMAGE
450        PAGE_OUTPUT_IMAGE_BUTTON
680        PAGE_OUTPUT_IMAGE_BUTTON
1025    NOTIFY_HANDLE_IMAGE
588        NOTIFY_HANDLE_IMAGE
740        NOTIFY_HANDLE_IMAGE
339        NOTIFY_MAIN_TEMPLATE_VARS_END_PRODUCT_INFO

Steve
github.com/torvista: BackupMySQL, Structured Data, Multiple Copy-Move-Delete, Google reCaptcha, Image Checker, Spanish Language Pack and more...

2 Jun 2013, 9:56 AM
#3
swguy avatar

swguy

Administrator

Join Date:
Feb 2006
Location:
Tampa Bay, Florida
Posts:
10,720
Plugin Contributions:
56

Re: Perfmon - A tool for finding performance bottlenecks

Yes - just find the slowest ones and focus on those.

That Software Guy. My Store: Zen Cart Support
Available for hire - See my ad in Services
Plugin Moderator, Documentation Curator, Chief Cook and Bottle-Washer.
Do you benefit from Zen Cart? Then please support the project.

19 Jul 2014, 8:10 PM
#4
swguy avatar

swguy

Administrator

Join Date:
Feb 2006
Location:
Tampa Bay, Florida
Posts:
10,720
Plugin Contributions:
56

Re: Perfmon - A tool for finding performance bottlenecks

Perfmon has been updated for Zen Cart 1.5.2 and 1.5.3.

That Software Guy. My Store: Zen Cart Support
Available for hire - See my ad in Services
Plugin Moderator, Documentation Curator, Chief Cook and Bottle-Washer.
Do you benefit from Zen Cart? Then please support the project.