template sctipt execution time

This is a discussion on template sctipt execution time within the PHP Language forums, part of the PHP Programming Forums category; Hi all! I'm progammer from Moscow, so sorry for my english. I wrote a template class, which has 2 ...


Go Back   Usenet Forums > PHP Programming Forums > PHP Language

FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 02-28-2008
Nchanged
 
Posts: n/a
Default template sctipt execution time

Hi all!
I'm progammer from Moscow, so sorry for my english.

I wrote a template class, which has 2 advanced options
1) Cash to mysql (it collects all tpl files, grabs them into one, and
pushes into db)
2) Cash to variable in file (collects all tpl files. creates in same
dir php file, creates function which returns array with full tpl data)

I thought, that the second pt. will decrease the exection time...
but.. as appeared - it's the longest one.Template file browsing (like
overwhelming majority template classes do - opening file, parsing..
next...) is the most quickest. I thought that using array solution
will be.

For example we have 20 files, and php must open each of them and
parse. What is the php load?

Question: What is the best solution? Or maybe i do smth wrong. Don't
know. Wanna write the most quickest script.

Thx,
Ivan
Reply With Quote
  #2 (permalink)  
Old 02-29-2008
Jerry Stuckle
 
Posts: n/a
Default Re: template sctipt execution time

Nchanged wrote:
> Hi all!
> I'm progammer from Moscow, so sorry for my english.
>
> I wrote a template class, which has 2 advanced options
> 1) Cash to mysql (it collects all tpl files, grabs them into one, and
> pushes into db)
> 2) Cash to variable in file (collects all tpl files. creates in same
> dir php file, creates function which returns array with full tpl data)
>


Other than the fact I think you mean "cache" instead of "cash", I find
your English very good - much better than my Russian :-)

> I thought, that the second pt. will decrease the exection time...
> but.. as appeared - it's the longest one.Template file browsing (like
> overwhelming majority template classes do - opening file, parsing..
> next...) is the most quickest. I thought that using array solution
> will be.
>


The arrays can take a lot of space. That can cause performance problems
unless you have a lot of RAM available on your server.

> For example we have 20 files, and php must open each of them and
> parse. What is the php load?
>


It depends many different things. First is whether a file is in the
system cache or not. Once it's loaded, it depends on the size and
complexity of the file. There are no general answers - every one is
specific to the file.

> Question: What is the best solution? Or maybe i do smth wrong. Don't
> know. Wanna write the most quickest script.
>


Templates, due to their nature, always take longer to process than
straight PHP files. You can write the quickest pages in assembler - but
that's not generally feasible. Non-template PHP scripts are pretty
good. But that doesn't mean you shouldn't use templates - they are
quite useful.

You need to find out where the delays are before you can determine how
to fix them. And if you can't optimize them any more (reasonably), then
you probably need a more powerful (faster CPU and/or disk, more RAM,
etc.) server.


> Thx,
> Ivan
>



--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
jstucklex@attglobal.net
==================

Reply With Quote
  #3 (permalink)  
Old 02-29-2008
Nchanged
 
Posts: n/a
Default Re: template sctipt execution time

thx for response, unfortunatly i send reply by "reply author". You
have reassured me=)


Reply With Quote
Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are Off
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT +1. The time now is 12:58 PM.


Powered by vBulletin® Version 3.7.3
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO 3.0.0