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
php first load time
Moderator: General Moderators
Re: php first load time
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
- greyhoundcode
- Forum Regular
- Posts: 613
- Joined: Mon Feb 11, 2008 4:22 am
Re: php first load time
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.
- Christopher
- Site Administrator
- Posts: 13596
- Joined: Wed Aug 25, 2004 7:54 pm
- Location: New York, NY, US
Re: php first load time
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.
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)