Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 3 of 3
  1. #1
    Regular Coder
    Join Date
    Jan 2005
    Posts
    470
    Thanks
    3
    Thanked 0 Times in 0 Posts

    gethostbyname() execution time

    I was recently testing some PHP code and found that a single line using gethostbyname() to fill a single variable was taking up about 3.5 seconds to execute.

    Is this PHP function usually so slow?

  • #2
    Super Moderator
    Join Date
    May 2002
    Location
    Perth Australia
    Posts
    4,073
    Thanks
    11
    Thanked 98 Times in 96 Posts
    no , even on my win32 dev machine on std ADSL the lookup time is not noticible & subsequent requests appear to be cached.
    resistance is...

    MVC is the current buzz in web application architectures. It comes from event-driven desktop application design and doesn't fit into web application design very well. But luckily nobody really knows what MVC means, so we can call our presentation layer separation mechanism MVC and move on. (Rasmus Lerdorf)

  • #3
    Regular Coder
    Join Date
    Jan 2005
    Posts
    470
    Thanks
    3
    Thanked 0 Times in 0 Posts
    Most of the time it executed it would take about 0.0002ms. About every 3rd run of the code that one line would take an average of 3.5 seconds to execute.

    This was on a Windows test server, though there was a lot of internet traffic in the background, the CPU was barely being used.


  •  

    Posting Permissions

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