performance issues sorrounding the use of multiple includes

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • monomaniac21

    performance issues sorrounding the use of multiple includes

    hi all

    can anyone tell me what the performance implications are of using
    multiple includes on a page. do includes increase performance in
    anyway? do they make a signifcantly negative impact? or is it negligible

  • Jerry Stuckle

    #2
    Re: performance issues sorrounding the use of multiple includes

    monomaniac21 wrote:
    hi all
    >
    can anyone tell me what the performance implications are of using
    multiple includes on a page. do includes increase performance in
    anyway? do they make a signifcantly negative impact? or is it negligible
    >
    Well, obviously there is some impact - PHP has to call the OS to load a
    new file, after all. But the overhead for parsing the file will be the
    same once it's loaded.

    If you're running that close to the limit that a few includes worry you,
    you need a faster server (or multiple servers).

    --
    =============== ===
    Remove the "x" from my email address
    Jerry Stuckle
    JDS Computer Training Corp.
    jstucklex@attgl obal.net
    =============== ===

    Comment

    • monomaniac21

      #3
      Re: performance issues sorrounding the use of multiple includes

      If you're running that close to the limit that a few includes worry you,
      you need a faster server (or multiple servers).
      >
      sorry i didnt make myself clear. say for example you have 30 incudes
      occuring in while loops pulling only a few scripts. is this going to be
      much slower than having the code (which isnt that big) in there instead?

      Comment

      • larry@portcommodore.com

        #4
        Re: performance issues sorrounding the use of multiple includes


        monomaniac21 wrote:
        If you're running that close to the limit that a few includes worry you,
        you need a faster server (or multiple servers).
        >
        sorry i didnt make myself clear. say for example you have 30 incudes
        occuring in while loops pulling only a few scripts. is this going to be
        much slower than having the code (which isnt that big) in there instead?
        Sounds like you need to make the 'included' script into a function and
        then use an include once at the beginning and call the function when
        needed, doing it the other way will definately be slower as you repeat
        all that code in your script 30 times as well as fetch it 30 times.

        Larry

        Comment

        • Jerry Stuckle

          #5
          Re: performance issues sorrounding the use of multiple includes

          monomaniac21 wrote:
          >>If you're running that close to the limit that a few includes worry you,
          >>you need a faster server (or multiple servers).
          >>
          >
          >
          sorry i didnt make myself clear. say for example you have 30 incudes
          occuring in while loops pulling only a few scripts. is this going to be
          much slower than having the code (which isnt that big) in there instead?
          >
          You should never need to include the same file more than once in another
          file. If you do you should rethink your logic.

          Larry's right - put the code in a function, include it once and call the
          function multiple times if necessary.

          --
          =============== ===
          Remove the "x" from my email address
          Jerry Stuckle
          JDS Computer Training Corp.
          jstucklex@attgl obal.net
          =============== ===

          Comment

          Working...