php first load time

Ye' old general discussion board. Basically, for everything that isn't covered elsewhere. Come here to shoot the breeze, shoot your mouth off, or whatever suits your fancy.
This forum is not for asking programming related questions.

Moderator: General Moderators

Post Reply
tzpow
Forum Newbie
Posts: 1
Joined: Thu Jan 29, 2009 1:28 pm

php first load time

Post 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
josh
DevNet Master
Posts: 4872
Joined: Wed Feb 11, 2004 3:23 pm
Location: Palm beach, Florida

Re: php first load time

Post 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
User avatar
greyhoundcode
Forum Regular
Posts: 613
Joined: Mon Feb 11, 2008 4:22 am

Re: php first load time

Post 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.
User avatar
Christopher
Site Administrator
Posts: 13596
Joined: Wed Aug 25, 2004 7:54 pm
Location: New York, NY, US

Re: php first load time

Post 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.
(#10850)
Post Reply