Shared vs Static Performance

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • tomdean20@gmail.com

    Shared vs Static Performance

    Does anyone have a general idea of the difference in performance when
    compiling PHP with primarily shared extensions rather than static? A
    recent Yahoo presentation "PHP at Yahoo" highlighted that they built
    PHP with the "disable-all" option, which implies that they load all of
    their extensions dynamically.

    I'd be curious if anyone has any experience in the performance
    difference bewteen the two, i.e. 5% performance loss, not just "it's
    only a little bit slower".

  • Andy Jeffries

    #2
    Re: Shared vs Static Performance

    On Tue, 18 Apr 2006 14:55:41 -0700, tomdean20 wrote:[color=blue]
    > Does anyone have a general idea of the difference in performance when
    > compiling PHP with primarily shared extensions rather than static? A
    > recent Yahoo presentation "PHP at Yahoo" highlighted that they built PHP
    > with the "disable-all" option, which implies that they load all of their
    > extensions dynamically.
    >
    > I'd be curious if anyone has any experience in the performance difference
    > bewteen the two, i.e. 5% performance loss, not just "it's only a little
    > bit slower".[/color]

    To be honest I think it'd make pretty much sod-all difference either way,
    at least on a Linux platform. Linux process forking using a Copy-on-write
    memory model, so creating a new apache/PHP process for a new connection
    (the only time dynamic linking to a shared extension would happen unless
    you literally load them in the script) is as lightweight either way as the
    entire processes memory is referenced twice and new memory only allocated
    if pages change.

    I'm sure Yahoo has found a slight increase in performance (or some other
    reason) or they'd do it the other way round, but I'd be surprised if
    performance difference was significant (of course, for a single option
    change during compile time it's worth doing even if relatively minor).

    Sorry to not give you a definitive answer, but I just thought I'd pipe up
    with that (in case anyone reading the thread doesn't know about Linux
    process forking).

    Cheers,


    Andy


    --
    Andy Jeffries MBCS CITP ZCE | gPHPEdit Lead Developer
    http://www.gphpedit.org | PHP editor for Gnome 2
    http://www.andyjeffries.co.uk | Personal site and photos

    Comment

    • NC

      #3
      Re: Shared vs Static Performance

      tomdean20@gmail .com wrote:[color=blue]
      >
      > Does anyone have a general idea of the difference in performance when
      > compiling PHP with primarily shared extensions rather than static? A
      > recent Yahoo presentation "PHP at Yahoo" highlighted that they built
      > PHP with the "disable-all" option, which implies that they load all of
      > their extensions dynamically.[/color]

      Yahoo! is not a typical PHP installation -- they run FreeBSD, a tweaked
      Apache, and their PHP is configured as a FastCGI executable... This is
      very different from your average PHP installation...

      Cheers,
      NC

      Comment

      Working...