Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#13 2014-06-12 10:00:54

Bongo-man
Member
Registered: 2009-03-18
Posts: 243

Re: [SOLVED] conditional active category, for different index pages

Thank you very much Etc, the script works good.

I’m customizing it about the style and in order, e.g., to have category titles only in the comprehensive parent category listing.
Afterwards I will add the article excerpt and image.

Excuse me, I previously reported an addictive erroneous note, about a supposed improvement (removing the second conditional expression).
Really it was a mistake, as I’ve afterwards realized; infact the lateral menu was no more working.

So, at now, I’m committed in trying to improve this expression, if possibile, in order reduce some of the server load, that this afternoon was reported as follow from the CMS (switched in test mode):

<!— Runtime: 0,3225 —>
<!— Query time: 0,292701 —>
<!— Queries: 37 —>
<!— Memory: 1703Kb, end of textpattern() —>

I’ve got a good improvement removing the 2 <txp:if_comments /> not necessary in my case

<!— Runtime: 0,1618 —>
<!— Query time: 0,120579 —>
<!— Queries: 40 —>
<!— Memory: 1718Kb, end of textpattern() —>

The queries above are referred to full article reporting in each parent-category index-page, but acting on the side menu I’ve noticed the server load is furtherly reduced.

Finally: it’s OK

Thank you all again.

Last edited by Bongo-man (2014-06-12 18:38:39)

Offline

#14 2014-06-12 21:03:46

etc
Developer
Registered: 2010-11-11
Posts: 5,388
Website GitHub

Re: [SOLVED] conditional active category, for different index pages

Glad it helps.

Bongo-man wrote #281393:

I’ve got a good improvement removing the 2 <txp:if_comments /> not necessary in my case

Unless there were <txp:comments /> or some other db-reading tags inside, that’s strange, I don’t think the parser itself takes so much time.

The number of queries (40) and the query time (0.12s) are still high, but it’s to be expected, because <txp:article_custom /> is called for each category. Here is a challenge for SQL-kings: how to retrieve in one (or few) queries three most recent articles from each category?

Offline

#15 2014-06-13 08:18:31

Bongo-man
Member
Registered: 2009-03-18
Posts: 243

Re: [SOLVED] conditional active category, for different index pages

I’ve reduced the server load again removing some other unnecessary queries, as follow

<!— Runtime: 0,0677 —>
<!— Query time: 0,039316 —>
<!— Queries: 31 —>
<!— Memory: 1691Kb, end of textpattern() —>

perhaps can be reduced again removing (if possible) the listing by category in the comprehensive parent-category switching (acting this way could be improved too) getting an uncategorized comprensive list. Isnt it?

Last edited by Bongo-man (2014-06-13 08:30:27)

Offline

#16 2014-06-13 08:55:49

gaekwad
Server grease monkey
From: People's Republic of Cornwall
Registered: 2005-11-19
Posts: 4,355
GitHub

Re: [SOLVED] conditional active category, for different index pages

Bongo-man wrote #281404:

<!— Runtime: 0,0677 —>
<!— Query time: 0,039316 —>
<!— Queries: 31 —>
<!— Memory: 1691Kb, end of textpattern() —>

That’s pretty good memory usage, actually – I’ve never managed to get the usage under 3000Kb on a production site.

Offline

#17 2014-06-13 09:14:19

Bongo-man
Member
Registered: 2009-03-18
Posts: 243

Re: [SOLVED] conditional active category, for different index pages

Really I’ve noticed the query are different in their number in different parent-index listing-pages.
I have some pages generated by a same template with 41 queries and other like that above with only 31.

They fall furtherly when I open a category-page by means of the later menu, activating categories. I’ve also noticed some queries are softer that others; so that the average server loud at now is:

<!— Runtime: 0,1-0,2 —> <!— Query time: 0,1-0,2 —>

That’s OK!

Last edited by Bongo-man (2014-06-13 09:23:50)

Offline

Board footer

Powered by FluxBB