Removing few functions from standard will not save more then a few kilobytes 
from the final binary (stripped). However, it'll create problems for people 
who try to write portable scripts relying on those extensions. For example 
ext/ctype is pretty basic functionality and is even enabled by default. 
However, many servers do not have it requiring a PHP wrapper to do the same. 
While it's relatively simple to re-implement ctype, that is not the case for 
some of the functions you want to remove. 
Unless PHP is used for most basic tasks it is pretty useless with 
--disable-all. 
Removing regex is a fine idea, BUT it used by code like browscap internally. 
Cooperatively speaking it would be better (binary size wise) to use regex 
rather then PCRE, which while better in many respects is by no means more 
compact. 

-1 on the removal idea

Ilia

P.S. Here are the sizes of the striped object files for some of the functions 
you want to remove:

metaphone.o (6156)
soundex.o (840)
uuencode.o (2308)
crc32.o (1660)
sha1.o (6696)
levenshtein.o (3440)
lcg.o (832)
image.o (11432)
cyr_convert.o (4104)

Overall saving <40kb, which is about 2.5% of the size of a PHP binary

On January 08, 2004 03:10 am, Andi Gutmans wrote:
> Hey,
>
> I just compiled PHP using --disable-all and realized that there's a shit
> load of relatively useless stuff still being compiled into it.
> The first thing I realized is that regex is still being compiled in by
> default. Are any parts of PHP's core relying on regex, thus, requiring it
> to be in the minimal build? I think most people today are using pcre and it
> would be great if we could support a version without regex.
> The second problem is in ext/standard with a zillion of functions. A lot of
> them are in my opinion not used by the majority of users and it would be
> great to be able not to compile them into PHP. Things that come to my mind:
> a) crc32
> b) cyr_convert
> c) image
> d) lcg
> e) metaphone
> f) soundex
> g) levenshtein
> h) sha1
> i) uuencode
>
> and probably some other stuff,
>
> In order for PHP users to get the most out of their servers, being able to
> reduce memory footprint as much as possible is quite important so that they
> can increase MaxClients to as much as possible.
>
> As we're in a code freeze for RC1 it's a bit late to do something about it,
> but I think it'd be nice to brainstorm about this to see how we can solve
> this, maybe for 5.1? If regex isn't required by the core that's one of the
> first things I'd like to see disabled when building with --disable-all.
> I think ext/standard should maybe be split up into two, the first ext/core
> and the second ext/standard where ext/core is the stuff which *really*
> needs to be part of PHP such as strlen(), file functions and pretty much
> stuff I didn't list in my list :)
>
> Any thoughts? Ideas? Flames? :)
> Andi

-- 
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to