Performance comparisons?

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

    #1

    Performance comparisons?

    Has anyone done any performance comparisons between what one might
    call the 'program' vs 'interjection' models?

    What I'm calling the 'program' model is putting a '<?php' invocation
    at the top of the page, a '?>' exit at the bottom, and doing all the
    html output via echo statements.

    The 'interjection' model, in contrast, repeatedly invokes php for
    minimal periods instead, so instead of one mass of php code, the same
    amount of code is in smaller pieces and laced in and out of the html.

    The interpreter must look at everything regardless, but I'm wondering
    whether there's significantly more overhead one way than the other.
    From the fact that 'echo' isn't actually a function, my guess is that
    the overhead might be a wash, but does anyone know of any actual
    performance tests?

    Margaret
    --
    (To mail me, please change .not.invalid to .net, first.
    Apologies for the inconvenience.)
  • Jochen Daum

    #2
    Re: Performance comparisons?

    Hi Margaret,

    On Wed, 24 Mar 2004 18:19:43 GMT, Margaret MacDonald
    <scratch65536@a tt.not.invalid> wrote:
    [color=blue]
    >Has anyone done any performance comparisons between what one might
    >call the 'program' vs 'interjection' models?
    >
    >What I'm calling the 'program' model is putting a '<?php' invocation
    >at the top of the page, a '?>' exit at the bottom, and doing all the
    >html output via echo statements.
    >
    >The 'interjection' model, in contrast, repeatedly invokes php for
    >minimal periods instead, so instead of one mass of php code, the same
    >amount of code is in smaller pieces and laced in and out of the html.
    >
    >The interpreter must look at everything regardless, but I'm wondering
    >whether there's significantly more overhead one way than the other.
    >From the fact that 'echo' isn't actually a function, my guess is that
    >the overhead might be a wash, but does anyone know of any actual
    >performance tests?[/color]

    I believe the performance difference is minimal in comparison to
    database accesses. But with your 'program' model its impossible to
    change the HTML code.

    HTH, Jochen
    --
    Jochen Daum - Cabletalk Group Ltd.
    PHP DB Edit Toolkit -- PHP scripts for building
    database editing interfaces.
    http://sourceforge.net/projects/phpdbedittk/

    Comment

    • Chung Leong

      #3
      Re: Performance comparisons?

      Uzytkownik "Margaret MacDonald" <scratch65536@a tt.not.invalid> napisal w
      wiadomosci news:rlj360ht69 5hqk3s2nrm4d3fl hblif2ttd@4ax.c om...[color=blue]
      > The interpreter must look at everything regardless, but I'm wondering
      > whether there's significantly more overhead one way than the other.
      > From the fact that 'echo' isn't actually a function, my guess is that
      > the overhead might be a wash, but does anyone know of any actual
      > performance tests?[/color]

      My guess is that injection wins by a whisker, since there's less to parse
      and fewer opcodes.


      Comment

      Working...