SitePoint Sponsor

User Tag List

Results 1 to 4 of 4
  1. #1
    SitePoint Enthusiast
    Join Date
    Sep 2005
    Posts
    49
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Why is PHP a slow programming language?

    Hello,

    Why is PHP so slow when compared with other programming languages?

    For example, the time that PHP takes to open one remote file and get its content via cURL or fopen is the same time that other programming languages (C++, VB,...) require to open and get content of tens of same-sized remote files. Why so?

  2. #2
    FBI secret agent digitman's Avatar
    Join Date
    Sep 2004
    Location
    Work
    Posts
    697
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I suppose it could be a compiler/interpreter thing?

  3. #3
    SitePoint Wizard silver trophy kyberfabrikken's Avatar
    Join Date
    Jun 2004
    Location
    Copenhagen, Denmark
    Posts
    6,157
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by chem3 View Post
    For example, the time that PHP takes to open one remote file and get its content via cURL or fopen is the same time that other programming languages (C++, VB,...) require to open and get content of tens of same-sized remote files. Why so?
    Most of time, used on accessing a remote file, comes from network and protocol overhead. That has nothing to do with the host language.

  4. #4
    . shoooo... silver trophy logic_earth's Avatar
    Join Date
    Oct 2005
    Location
    CA
    Posts
    9,013
    Mentioned
    8 Post(s)
    Tagged
    0 Thread(s)
    HTTP is very slow there are seven layers an application must go thought before it ever gets to the internet. And won't mention how many times a frame must be broken down to a packet then rebuilt which adds even more overhead.

    PHP won't execute as fast as C, C++, or VB because it is not compiled. Instead it is uninterpreted at runtime, parsed, processed into byte-code, then into machine code where its executed.
    Logic without the fatal effects.
    All code snippets are licensed under WTFPL.



Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •