Jump to content

Question: Why not so fast ?


Recommended Posts

Question: I have a PHP script that can finish running within

7 minutes on a 2008 Mac Book Pro Laptop running

Windows XP . The Mac book pro is core 2 duo 2.5 GHz

with 2 gbs of ram.

How ever when I run the same script on

a Dell Desktop Windows XP 2010 computer it takes 15 to

30 minutes to finish. Stats for the Dell are Intel core 2 duo

CPU e7500, 2.93 GHz with 1.93 gbs of ram. Why does 

the Mac runs the PHP so much faster ? How does a 2 yr 

old Laptop bests a brand new desktop in running PHP ?

 

Thank you for your answers.  :shrug:

Link to comment
Share on other sites

Execution time is so much more complicated than just "lol i haz fast cpu and lotsa ram".

 

What does the script do? Does it involve network connections? Disk access? Database access? Does it use output from other programs? How much code is userland and how much isn't? Are the PHP versions very different? Which extensions are installed? Running as a command-line script? CGI or FastCGI program? Apache module or ISAPI filter in IIS?

 

Do you get the picture?

Link to comment
Share on other sites

I appreciate the information, thank you.

I went back and checked.  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 script does is it copies the information from several files into one file. It then reads that information into 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.

 

If the PHP environments are the same and I am not using servers what else could be affecting the computer to make PHP run 2-3 times slower than on the other computer.  :shrug:

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.