Using too many functions will increase server load or anything ??

Discussion in 'PHP' started by vaakash, Apr 2, 2010.

  1. #1
    Using too many functions in php will increase server load or anything ?? :confused:
     
    vaakash, Apr 2, 2010 IP
  2. ThomasTwen

    ThomasTwen Peon

    Messages:
    113
    Likes Received:
    4
    Best Answers:
    0
    Trophy Points:
    0
    #2
    Very basically - putting any additional commands in your scripts will increase the server load, because its one more thing the server has to do.

    If you're worrying whether or not you can create your own functions: You can do it. Creating a function is faster than putting the same code 10 times throughout your code.
     
    ThomasTwen, Apr 3, 2010 IP
  3. learnerabn

    learnerabn Peon

    Messages:
    131
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #3
    It depends on the way you use the function.if the code needs to be excuted only once means it is waste.
    if the code should be executed more times then it is recommended to use functions than repeating the code.
     
    learnerabn, Apr 3, 2010 IP
  4. Brandon.Add.On

    Brandon.Add.On Peon

    Messages:
    178
    Likes Received:
    4
    Best Answers:
    0
    Trophy Points:
    0
    #4
    If you include the function you aren't really increasing any loading time but the amount of memory used which in turn can slow down other functions that are being used.
     
    Brandon.Add.On, Apr 3, 2010 IP
  5. vaakash

    vaakash Member

    Messages:
    127
    Likes Received:
    3
    Best Answers:
    0
    Trophy Points:
    35
    #5
    I am using wordpress and i need to call to certain functions within a LOOP more than 10 or 15 times. So i am just worrying about server load and other related.
     
    vaakash, Apr 3, 2010 IP
  6. funmasti.org

    funmasti.org Peon

    Messages:
    107
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #6
    ya it will.. but not in a big amount
     
    funmasti.org, Apr 4, 2010 IP
  7. Gray Fox

    Gray Fox Well-Known Member

    Messages:
    196
    Likes Received:
    8
    Best Answers:
    0
    Trophy Points:
    130
    #7
    You should worry more about DB queries and functions that parse large amounts of data (and cache them, of course). Small functions really make no big difference. You can read more about optimizing your PHP code on blogs like this: http://www.chazzuka.com/blog/?p=58
     
    Gray Fox, Apr 5, 2010 IP