On 18 November 2014 20:22, Rainer Jung <rainer.j...@kippdata.de> wrote:

> Hi there,
>
> the default build process of PHP on Unix/Linux links together all code
> needed for any SAPI that one builds (excluding dynamically loadable
> extensions). This often leads to relatively big SAPI shared object files.
> But most of this code is exactly the same for all SAPIs. That adds
> considerable to the package size if one ships e.g. CLI, CGI, mod_php and
> FPM.
>
> One could instead use one common shared library which conatins most of the
> code and only small additional SAPI shared object files with the SAPI
> specifics.
>
> I twisted the existing build process to achieve this building of a common
> lib plus one shared object per SAPI and it seems to work well. Is there any
> interest in adopting the existing build process to this?
>
> I can provide details how I do it currently. I use it for 5.5 and 5.6, but
> I expect it to work similarly for master which would probably be the target
> for the change.
>
> Thanks for any feedback,
>
> Rainer


I believe this is how the Windows bins are built, with relatively small
binaries for the SAPI entry points and most of the code shared in
php5.dll/php5ts.dll.

While there's no problem with this approach in general, there are a couple
of points here:

- It makes running more than one version of PHP on the same machine that
little bit more complex.
- The wasted space we are talking about here is only a matter of a few MBs,
tens of MBs at the most. In terms of modern computing this is almost
nothing.

In short, while I have no problem with altering the build process to make
this *an option*, I wouldn't like it to be the default behaviour because
the gains are just not big enough and it creates a couple of extra tripping
hazards.

Thanks, Chris

Reply via email to