This is a discussion on Advantages and disadvantages of PHP? within the PHP Language forums, part of the PHP Programming Forums category; Jonathan Sachs wrote: > > > Speaking technically, it seems to me that PHP is likely to be a poor &...
|
|||||||
| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
|
|||
|
Jonathan Sachs wrote:
> > > Speaking technically, it seems to me that PHP is likely to be a poor > choice for large-scale services where hundreds or thousands of users > will be hitting the web site at the same time. I'm guessing, though, > and I wouldn't know how to judge how large is too large. Perhaps > there are other areas where PHP is particularly weak or strong, which > I do not yet know enough to wonder about. Hence, my question. The current trend eems to be to throw processor power and RAM at such sites. If you have such, you probably would also have an Oracle Database underneath, not MySql :-) I picked PHP because I wanted fast prototyping of sonething running on a cheap platform, for moderate traffic only. Its actually pretty good. I am more bandwidth limited than processor bound, and probably RAM would be the first thing I would add. There is no doubt that writing in C would be immensely more efficient than an interpreter, but then you have the usual compile/link/install to do every time you make a change. However there is no reason why you could not pretty much recode any time critical bits into 'C'..r write a whole PHP library in 'C' that did your clever bits.* In the end execution efficiency is almost never a dominant issue..with PHP, MYSQL and Apache, especially on a Linux OS, you have an ideal platform that costs next to nothing to develop applications. A thousand concurrent users hitting it would probably cripple it sure, but by then you should have the money and the reason to migrate to something top end, if that's what's needed. I would regard the above as the de-facto standards for small to medium website development. *Where does one find out how to do this? I might need to one day... |
|
|||
|
Gilles Ganault wrote:
> On Sun, 17 Feb 2008 16:23:34 GMT, Jonathan Sachs > <js070717@sbcglobal.net> wrote: >> I'll repeat that I'm guessing here. My guess is based on the fact >> that PHP is (as far as I know) an interpreted language, while Java is >> a JIT compiled language. > > Does someone have data on whether JIT-compiled Java is faster than > cached PHP opcode? > >> The fact that Java and C# are strongly typed languages may also have >> an effect on the scalability of applications, as well as their >> robustness and maintainability. > > That's a good reason. As is the difficulty of ripping off the source if for some reason the 3rd party server suddenly delivers pages of PHP source to you ;-) It happens.. |
|
|||
|
Jonathan Sachs wrote:
> On Sun, 17 Feb 2008 17:07:36 +0100, Gilles Ganault <nospam@nospam.com> > wrote: > >> On Sun, 17 Feb 2008 09:14:10 -0600, Jonathan Sachs >> <js070717@sbcglobal.net> wrote: >>> Speaking technically, it seems to me that PHP is likely to be a poor >>> choice for large-scale services where hundreds or thousands of users >>> will be hitting the web site at the same time. >> Based on what data? I'm interested, because I wonder why all those big >> companies choose Java, which is so much more verbose and intricate >> than Python, so I assume they have a reason for choosing that >> language. > > I'll repeat that I'm guessing here. My guess is based on the fact > that PHP is (as far as I know) an interpreted language, while Java is > a JIT compiled language. > > I'm aware that many servers can reduce overhead by page caching, but > that is a more limited strategy than compilation. There are > situations where it would be almost equally effective... others where > it would be almost useless. > > The fact that Java and C# are strongly typed languages may also have > an effect on the scalability of applications, as well as their > robustness and maintainability. > You will find that often java is slower than PHP. Don't guess. Get the facts. -- ================== Remove the "x" from my email address Jerry Stuckle JDS Computer Training Corp. jstucklex@attglobal.net ================== |
|
|||
|
On Sun, 17 Feb 2008 14:16:25 -0500, Jerry Stuckle
<jstucklex@attglobal.net> wrote: >You will find that often java is slower than PHP. > >Don't guess. Get the facts. Can you refer me to a source of information on this, or at least explain why it is so? I value facts, but I do not have the ability to pull them out of thin air. The value of USENET lies in the ability of like-minded people to share information, so that each person does not have to reinvent or rediscover the wheel for him or herself. Please share a little. |
|
|||
|
Jonathan Sachs wrote:
<snip> > > Speaking technically, it seems to me that PHP is likely to be a poor > choice for large-scale services where hundreds or thousands of users > will be hitting the web site at the same time. I'm guessing, though, > and I wouldn't know how to judge how large is too large. Perhaps > there are other areas where PHP is particularly weak or strong, which > I do not yet know enough to wonder about. Hence, my question. I am not sure about the back-end, but at the front end, Facebook uses Php and JS. Signing in takes you to the page below. Facebook's popularity can be judged at Alexa. http://www.facebook.com/home.php? http://www.alexa.com/data/details/tr...s/facebook.com |
|
|||
|
Jonathan Sachs wrote:
> On Sun, 17 Feb 2008 14:16:25 -0500, Jerry Stuckle > <jstucklex@attglobal.net> wrote: > >> You will find that often java is slower than PHP. >> >> Don't guess. Get the facts. > > Can you refer me to a source of information on this, or at least > explain why it is so? > > I value facts, but I do not have the ability to pull them out of thin > air. The value of USENET lies in the ability of like-minded people to > share information, so that each person does not have to reinvent or > rediscover the wheel for him or herself. Please share a little. > Because they are two different approaches to programming. Just because java is precompiled doesn't necessarily make it faster. There are many other things to take into consideration. As I said - run your own tests. -- ================== Remove the "x" from my email address Jerry Stuckle JDS Computer Training Corp. jstucklex@attglobal.net ================== |
|
|||
|
On Sun, 17 Feb 2008 12:31:17 -0800, Animesh K <animesh1978@gmail.com>
wrote: >I am not sure about the back-end, but at the front end, Facebook uses >Php and JS. Signing in takes you to the page below. Facebook's >popularity can be judged at Alexa. BTW, if I include some JS libraries/components in each page, are they cached by the browser so that it doesn't need to download those files again the next time? |
|
|||
|
Gilles Ganault wrote:
> On Sun, 17 Feb 2008 12:31:17 -0800, Animesh K <animesh1978@gmail.com> > wrote: >> I am not sure about the back-end, but at the front end, Facebook uses >> Php and JS. Signing in takes you to the page below. Facebook's >> popularity can be judged at Alexa. > > BTW, if I include some JS libraries/components in each page, are they > cached by the browser so that it doesn't need to download those files > again the next time? > Maybe, maybe not. It depends on the browser, the options the user has set, and even possible caching by ISP's between you and the client. The only think you know for sure is it's something you have absolutely no control over. -- ================== Remove the "x" from my email address Jerry Stuckle JDS Computer Training Corp. jstucklex@attglobal.net ================== |
|
|||
|
Jerry Stuckle wrote:
> Gilles Ganault wrote: >> On Sun, 17 Feb 2008 12:31:17 -0800, Animesh K <animesh1978@gmail.com> >> wrote: >>> I am not sure about the back-end, but at the front end, Facebook uses >>> Php and JS. Signing in takes you to the page below. Facebook's >>> popularity can be judged at Alexa. >> >> BTW, if I include some JS libraries/components in each page, are they >> cached by the browser so that it doesn't need to download those files >> again the next time? >> > > Maybe, maybe not. It depends on the browser, the options the user has > set, and even possible caching by ISP's between you and the client. > > The only think you know for sure is it's something you have absolutely > no control over. > Well your worst-case point of not knowing is valid, but for a large fraction of users, caching (up to about 50MB or more) is enabled by default. Most people use IE 6 or IE 7. Even those who move to firefox don't go to advanced settings. |
|
|||
|
Animesh K wrote:
> Jerry Stuckle wrote: >> Gilles Ganault wrote: >>> On Sun, 17 Feb 2008 12:31:17 -0800, Animesh K <animesh1978@gmail.com> >>> wrote: >>>> I am not sure about the back-end, but at the front end, Facebook >>>> uses Php and JS. Signing in takes you to the page below. Facebook's >>>> popularity can be judged at Alexa. >>> >>> BTW, if I include some JS libraries/components in each page, are they >>> cached by the browser so that it doesn't need to download those files >>> again the next time? >>> >> >> Maybe, maybe not. It depends on the browser, the options the user has >> set, and even possible caching by ISP's between you and the client. >> >> The only think you know for sure is it's something you have absolutely >> no control over. >> > > Well your worst-case point of not knowing is valid, but for a large > fraction of users, caching (up to about 50MB or more) is enabled by > default. Most people use IE 6 or IE 7. Even those who move to firefox > don't go to advanced settings. > Not necessarily. In fact, I've found most users are using 10MB caching at max. Many are using less than that. What you say may be valid for people who know absolutely nothing about computers. But I've found users on many of my sites are relatively intelligent. That doesn't mean they can write programs - but they can fool around with their browser settings. -- ================== Remove the "x" from my email address Jerry Stuckle JDS Computer Training Corp. jstucklex@attglobal.net ================== |