Does unset() really make a performance difference in scripts?

Discussion in 'PHP' started by interwho, Dec 12, 2010.

  1. #1
    Does the unset() function really make a performance difference in scripts that pass around a large number of 500kb variables?
     
    interwho, Dec 12, 2010 IP
  2. shofstetter

    shofstetter Well-Known Member

    Messages:
    178
    Likes Received:
    7
    Best Answers:
    1
    Trophy Points:
    120
    #2
    unset will reduce memory requirements, but is a minor player in the whole optimisation scheme. Check out:

    http://phplens.com/lens/php-book/optimizing-debugging-php.php

    for solutions on how to get your code to execute around 50% faster. There are many tweaks, and the page also explains how the code is run on the server. As usual general programming tweaks such as limiting file access, tight loops, etc will also help with speed.
     
    shofstetter, Dec 12, 2010 IP