Categories > TinyButStrong general >

It's slow when display a big template file

The forum is closed. Please use Stack Overflow for submitting new questions. Use tags: tinybutstrong , opentbs
By: Trong Ho Van
Date: 2004-05-07
Time: 12:20

It's slow when display a big template file

I have a template file around 27KB, and there's 3 tbs_check and  around 4 vars in 27KB template.

It's take around 10 secs to load that page.

I used 2 x PII 233, Apache 1.3.29 SSL, PHP 4.06

Maybe this is a bug or a leak memory when you parse the template.

If you want to review my template you can come to http://office.cadena-it.com/tinybutstrong/useredit.htm
Anyone could help me out of this ?
By: Skrol29
Date: 2004-05-07
Time: 12:57

Re: It's slow when display a big template file

Hello Trong,

Your template uses the parameter 'selected' on 3 listboxes which have very lot of items. I guess that is the main timing problem.

I suggest that you use Javascript to perform the listbox selection.
Here is an example on how it can be done:
function m_Init(item_id) {
  if (item_id==0) {
    document.forms['myform'].elements['mylist'].selectedIndex = 0
  } else {
    document.forms['myform'].elements['mylist'].value = item_id
  }
}
...
<body onLoad="javascript:m_Init([var.item_id])">
By: RwD
Date: 2004-05-07
Time: 13:03

Re: It's slow when display a big template file

Surely not 10 seconds for those little lists??
I'll give it a try when I get home, perhaps it is something else??
By: Skrol29
Date: 2004-05-07
Time: 14:22

Re: It's slow when display a big template file

Yes you're right RwD!

Using Trong's template, , I save 0.17 second  when I deactivate the 3 TBS tags for list boxes item selection. (I have 1.27 second for the normal template).
But when I deactivate the 5 TBS tags for checkboxes item selection, I save 0.56 seconds.

So the time problem mostly comes from parameter 'selected' on checkboxes.
I'm not very suprised. To found checkboxes to browse inside a <form> tag itself embeded in a template, is not a simple task.

I suggest Javascript for the checkboxes selection.
See the example a my previous post.


By: Trong Ho Van
Date: 2004-05-08
Time: 04:48

Re: It's slow when display a big template file

Thank for your all reply,

I tested all your solution and finally I make a long Country and state select box by the code.

And disable 5 tbs checked and insert into each radio box with tbs if check. The speed is acceptable now.

Trong Ho
By: RwD
Date: 2004-05-09
Time: 08:51

Re: It's slow when display a big template file

Huh?

Was the original name of the poster of the first answer not "Translator" ??
By: Skrol29
Date: 2004-05-09
Time: 17:48

Re: It's slow when display a big template file

It used to be written "Translator". But "Translator" is the nickname I use to translate french thraads into english. So I've fixed my mistake into the Forum Database. I can do that because I'm the administator.