ExpressionEngine CMS
Open, Free, Amazing

Thread

This is an archived forum and the content is probably no longer relevant, but is provided here for posterity.

The active forums are here.

Simple Commerce Execution Time

May 16, 2012 4:30pm

Subscribe [2]
  • #1 / May 16, 2012 4:30pm

    peachorama

    35 posts

    Hello, I’ve noticed on templates where I’m using the simple commerce tag, the Total Execution Time is much higher than on templates where I’m not using that tag.

    For example, I’ve a template that displays 15 entries and using the simple commerce tag to display their price, the Execution Time is on average 6 seconds. Without displaying the price, the Execution time is under 1 second.

    Any reason why this is and is there anything I can do to improve the Execution time using the simple commerce tag?

    Thanks in advance!

  • #2 / May 17, 2012 1:21pm

    Dan Decker

    7338 posts

    Hi peachorama,

    Thanks for your question!

    Can you tell me what version of ExpressionEngine you are using?

    Can you show me your template as well?

    Have you run template debugging as part of your timing process?

    Cheers,

  • #3 / May 17, 2012 2:16pm

    peachorama

    35 posts

    Hi Dan, thanks for your response. I’m using v2.5.0. Here’s my template:

    {embed="site/masthead" page_title="Books"}
    <body id="books">
    {header}
    <div id="content-wrapper">
    <div id="content">
    {sort}
    {exp:channel:entries channel="books" limit="15" paginate="bottom" paginate_base="books/page" disable="categories|member_data|category_fields"}
    <div class="item-group">
    <div class="item-image">
    {item_images limit="1"}
    {exp:imgsizer:size src="{image}" auto="200"}
    <a href="http://{title_permalink=books}">{sized}</a>
    {/exp:imgsizer:size}
    {/item_images}
    </div>
    <div class="item-info">
    <a href="http://{title_permalink=books}"></a>
    <div class="info">
    <h2>{item_author}</h2>
    <h3>{item_title}</h3>
    <p>{exp:simple_commerce:purchase entry_id="{entry_id}" success="" cancel=""}<br />
    ${item_regular_price}<br />
    {/exp:simple_commerce:purchase}<br />
    </div><br />
    {pagelinks}<br />
    </div><br />
    </div><br />
    {/exp:channel:entries}<br />
    </div><br />
    </div><br />
    </body><br />
    </html>

    As I mentioned, by simply removing

    {exp:simple_commerce:purchase entry_id="{entry_id}" success="" cancel=""}
    ${item_regular_price}
    {/exp:simple_commerce:purchase}

    the page is about 4 seconds faster. I have template debugging on but to be honest I am not an expert in deciphering it.

    Thanks for your help!

  • #4 / May 22, 2012 2:47pm

    Dan Decker

    7338 posts

    Hi peachorama,

    the page is about 4 seconds faster. I have template debugging on but to be honest I am not an expert in deciphering it.

    No worries, that’s what I’m here for! Can you post the output of the debugger?

    If you want a clue as to what to look for, note the execution time. Look for a large increase in the time, say it jumps from 1 second to 4 seconds. The output near those spikes would be the most helpful.

    Also, try setting values for the success=”” and cancel=”” parameters, or removing them altogether.

    Cheers,

  • #5 / May 22, 2012 8:33pm

    peachorama

    35 posts

    Hi Dan,

    I’ve been monitoring the Execution times more closely and they seem to fluctuate alot, probably due to shared hosting. I’ve also examined the Template Debugging and it appears that it does not have any jumps in the “seconds”. I think the parsing/processing of the Simple Commerce tag for 15 entries incrementally increases the time (as it probably should):

    (0.494019 / 14.93MB) Tag: {exp:simple_commerce:purchase entry_id="131" success="site/complete" cancel="books"}
    (0.494082 / 14.93MB) Closing Tag Found
    (0.494144 / 14.94MB) Tag: {exp:imgsizer:size src="http://www.test.com/fr_items/Scadr.jpeg" height="200"}
    (0.494198 / 14.94MB) Closing Tag Found
    (0.494259 / 14.94MB) Tag: {exp:simple_commerce:purchase entry_id="130" success="site/complete" cancel="books"}
    (0.494316 / 14.94MB) Closing Tag Found
    (0.494375 / 14.95MB) Tag: {exp:imgsizer:size src="http://www.test.com/fr_items/JAG.jpeg" height="200"}
    (0.494427 / 14.95MB) Closing Tag Found
    (0.494486 / 14.95MB) Tag: {exp:simple_commerce:purchase entry_id="129" success="site/complete" cancel="books"}
    (0.494542 / 14.95MB) Closing Tag Found
    (0.494602 / 14.96MB) Tag: {exp:imgsizer:size src="http://www.test.com/fr_items/BURR.jpeg" height="200"}
    (0.494655 / 14.96MB) Closing Tag Found
    and so on…..

    (0.497942 / 15.10MB) Module Tag: Simple_commerce/purchase
    (0.497961 / 15.10MB) Plugin Tag: Imgsizer/size
    (0.497977 / 15.10MB) Module Tag: Simple_commerce/purchase
    (0.497995 / 15.10MB) Plugin Tag: Imgsizer/size
    (0.498011 / 15.10MB) Module Tag: Simple_commerce/purchase
    (0.498028 / 15.10MB) Plugin Tag: Imgsizer/size
    (0.498046 / 15.10MB) Module Tag: Simple_commerce/purchase
    (0.498064 / 15.10MB) Plugin Tag: Imgsizer/size
    (0.498082 / 15.11MB) Module Tag: Simple_commerce/purchase
    (0.498100 / 15.11MB) Plugin Tag:
    and so on…..

    I guess I’ve concluded that the more third-party add-ons are in the template, the slower the page is? Is that correct?

    Thanks very much for pointing me in the right direction!

    -patricia (peachorama)

  • #6 / May 30, 2012 4:18pm

    Dan Decker

    7338 posts

    Hi Patricia,

    I guess I’ve concluded that the more third-party add-ons are in the template, the slower the page is? Is that correct?

    Thanks very much for pointing me in the right direction!

    Indeed - Especially ones like imagsizer that have to “do work” as part of the processing.

    What you want to be mindful of is the total execution time, the last numbers reported in template debugging. As long as those aren’t in the several seconds range, you should be in good shape.

    Is there anything else I can assist you with?

    Cheers,

  • #7 / Jun 05, 2012 12:30pm

    peachorama

    35 posts

    Hi Dan, thanks so much for your help on this! I do not need anything further.

    have a great day,
    patricia

  • #8 / Jun 08, 2012 5:52pm

    Shane Eckert

    7174 posts

    Hi peachorama,

    I am glad that Dan was able to help you!

    If you need anything else, please just let us know by opening a new thread.

    Cheers,

.(JavaScript must be enabled to view this email address)

ExpressionEngine News!

#eecms, #events, #releases