Problems, need help? Have a tip or advice? Post it here.
19 posts Page 2 of 2
17.43 Second load time, 16.29 just for the HTML :(

I was thinking about what you said regarding the template design.... and I immediately thought about what might cause extra work for the server. This is the first culprit that comes to my mind:

Code: Select all
<cms:pages folder=k_page_foldername>
    <cms:if k_page_name=page_name><cms:set page_count=k_count scope='global' /></cms:if>
</cms:pages>



   

<div id="navigator" >

<div  align="center" class="ui">

<!-- start previous arrow -->

    <div class="chv">
        <div class="table full-width full-height">       
            <div class="table-cell align-bottom">
                <cms:pages folder=k_page_foldername   >    <cms:if k_count="<cms:sub page_count '1' />"> <a href="<cms:show k_page_link />" class="transition"> <div id="linkinner" class="desktopbutton"><img src="<cms:show k_site_link />uparrow.png" ></img> </div>   <div id="linkinner" class="tabletbutton"><img src="<cms:show k_site_link />leftarrow.png" ></img> </div></a></cms:if></cms:pages>
            </div>
        </div>

<!-- start next arrow -->       
       
        <div class="table full-width full-height">       
            <div class="table-cell align-top">
                <cms:pages  folder=k_page_foldername >  <cms:if k_count="<cms:add page_count '1' />">  <a href="<cms:show k_page_link/>" class="transition"> <div id="linkinner" class="desktopbutton"><img src="<cms:show k_site_link />downarrow.png" ></img> </div>   <div id="linkinner" class="tabletbutton"><img src="<cms:show k_site_link />rightarrow.png" ></img> </div></a></cms:if></cms:pages>
            </div>
        </div>
That sure is the culprit :)
So suppose there are 300 pages, the code will (worst-case scenario) loop through *all* of them *thrice* i.e. 900 iterations.

You seem to be using the very first solution described at viewtopic.php?f=8&t=7087 (Next & Prev links in page view).

The same thread also mentions a more optimized solution as the last post -
viewtopic.php?p=9409#p9409

I suggest you please try that out (will require a minor tweak to add the folder=k_page_foldername).

Please let know if it helps.
KK - It's worse than that.... I that code is used two times on page due to the multi view design of the layout..... WOW. You might just have saved me a ton of cash on dedicated hosting! :D :D :D
:lol:
Do share the page load-time with the revised code.

Thanks.
This may be more server related than couch related. I just tried surfing my shared hosted version of the gallery tonight with the original code (about midnight my time), and my total page load times are about 7-8 seconds, the HTML taking 6.5-7.5 of those seconds to retrieve. That's twice as fast as when I tried around 11AM my time.

I commented out all of the code that was related to the page looping - it does speeding things up, but only by about 0.5 seconds.

Is there anything else that could be couch related?

My non-optimized (default install) LAMP development server loads the pages in about 4.3 - 4.5 seconds with a few hundred images in a given folder using the old looping code. I'd post the code here, but it's pretty sizeable (958 lines).
OK - some news... I just got my shared hosting server to throw this error..... while I was using the original page navigation code.

Fatal error: Allowed memory size of 67108864 bytes exhausted (tried to allocate 464 bytes) in /home/cardmaverick/public_html/chrisnuzzaco.com/couch/page.php on line 260


By the way, the worst load time I had during the daytime hours on the shared server was.... 30 seconds!
I just noticed something... commenting out couch tags does not seem to shut them off :oops: . I'm going to re-test by manually deleting them from the document. Worth noting, in the original test, I did get rid of the original code that preceeds the link generating codes:

Code: Select all
<cms:pages folder=k_page_foldername>
    <cms:if k_page_name=page_name><cms:set page_count=k_count scope='global' /></cms:if>
</cms:pages>


I had copied and pasted the more optimized one in its place before deciding to just comment out all couch code dealing with next / prev links. Maybe this still is a sluggish code issue....
I DID IT!!!!!

118 images in folder:

SHARED HOSTING HTML LOAD TIME: 800ms - 2.0 seconds (I suspect server load from other sites is the reason for the wide range).

258 images in folder:

DEVELOPMENT SERVER: 300 - 500 ms

Wooo hooo!!!!

I ripped out the old code totally (deleted, not commented out), then pasted in the generic optimized code (no mods yet). Major improvement, to say the least.

Thanks KK!!!!
I sure am glad cardmaverick :)

Commenting out Couch code requires enclosing it within <cms:ignore> .. </cms:ignore> tags. I think you were not using those when you tried to comment out the unoptimized code.
19 posts Page 2 of 2

Who is online

In total there are 2 users online :: 0 registered, 0 hidden and 2 guests
(based on users active over the past 5 minutes)

Users browsing this forum: No registered users and 2 guests

cron