SitePoint Sponsor

User Tag List

Results 1 to 4 of 4
  1. #1
    SitePoint Member
    Join Date
    Dec 2010
    Posts
    1
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Question PHP: Why not so fast ?

    I have a PHP script that runs fast on a 2008 Mac Book Pro Laptop but it runs very slow on a brand new Dell desktop. If the PHP environments are the same and I am not using servers what else could be affecting the Dell to make PHP run 2-3 times slower than on the MAC computer?

    Details: The PHP working environments are exactly the same i.e. both PHP.ini files are the same, extensions used are the same ect...No it does not involve network connections or database use. There is no out put from other programs and no PHP userland. I have the exact same PHP versions 5.2.9 and same exact extension are installed. I execute PHP scripts from the MSDOS command line interface. Not using any servers.

    What the PHP script does is it copies the information from
    several files into one file. It then reads that information
    nto an array and uses array_count_values to set up an
    array_key_exists search. If it is found number is
    appended to a file. The data sets are about a million
    numbers and this is repeated about 150 times.

    Any suggestions to speed up the PHP on the Dell computer would be greatly appreciated.

  2. #2
    Floridiot joebert's Avatar
    Join Date
    Mar 2004
    Location
    Kenneth City, FL
    Posts
    823
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Does the Dell computer have Microsoft's active process monitoring, or other Anti-virus software running?

  3. #3
    SitePoint Zealot
    Join Date
    Jun 2010
    Location
    Arizona
    Posts
    109
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    If the Dell is Windows 7 64-bit, make sure it isn't this issue:

    http://cubicspot.blogspot.com/2010/0...ost-under.html

    Also, array_key_exists() is slower than isset(). The first is a function, the latter is a keyword.
    Thomas Hruska

    Single Sign-On Server/Client - The PHP login system that rocks.

  4. #4
    SitePoint Wizard silver trophybronze trophy Cups's Avatar
    Join Date
    Oct 2006
    Location
    France, deep rural.
    Posts
    6,869
    Mentioned
    17 Post(s)
    Tagged
    1 Thread(s)
    Does the dell have a hosts file, and if you are accessing http://localhost is that entry in your hosts file?

    If not you might be getting caught in a dns lookup trap.

    (needs server restart)

    Is your dell perhaps running IIS as well as apache?


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
  •