Page 1 of 1

php first load time

Posted: Thu Jan 29, 2009 1:55 pm
by tzpow
Hi,

I am a .net developer and thinking about learning php. As you may know .net application takes a few seconds to compile on the first load even though just one simple line of redirect. My question is does php goes through a few seconds as well during the first visit? I want to write a collection.php page. This page is nothing complicated, it checks user's location based on ip and insert into db and then redirect to another page. Does php compile on the first load also? I guess i wanted this to be invincible to the user can it be done with php?

thanks

jb

Re: php first load time

Posted: Thu Jan 29, 2009 4:06 pm
by josh
No PHP uses byte codes and is interpreted not compiled. It is parsed on every page but definitely doesn't suffer from the symptoms you just described

Re: php first load time

Posted: Sun Feb 15, 2009 2:28 pm
by greyhoundcode
If your making ASP.NET pages with C# or VB.NET or whatever you can compile to native so that there is no lag on the first-time run.

Re: php first load time

Posted: Sun Feb 15, 2009 2:42 pm
by Christopher
I think the first question you should ask yourself is: Am I worrying about an implementation detail, such as pre-compliation, when I don't have an actual problem that needs to be solved? Does my admittedly uncomplicated page perform so poorly in PHP that I have a problem that needs to be solved?

If so then there are things like op-code caches and other techniques that can be employed in PHP to improve performance. But if you don't have a real problem, then by focusing on this you are not spending time on more important parts of your application.