Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:6852 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 68042 invoked by uid 1010); 8 Jan 2004 14:15:30 -0000 Delivered-To: ezmlm-scan-internals@lists.php.net Delivered-To: ezmlm-internals@lists.php.net Received: (qmail 68018 invoked from network); 8 Jan 2004 14:15:30 -0000 Received: from unknown (HELO asuka.nerv) (24.112.18.98) by pb1.pair.com with SMTP; 8 Jan 2004 14:15:30 -0000 Received: (qmail 17857 invoked from network); 8 Jan 2004 14:15:30 -0000 Received: from rei.nerv (HELO dummy.com) (rei@192.168.1.1) by asuka.nerv with SMTP; 8 Jan 2004 14:15:30 -0000 Reply-To: ilia@prohost.org To: Andi Gutmans , internals@lists.php.net Date: Thu, 8 Jan 2004 09:15:31 -0500 User-Agent: KMail/1.5.94 References: <5.1.0.14.2.20040108100152.02029de8@127.0.0.1> In-Reply-To: <5.1.0.14.2.20040108100152.02029de8@127.0.0.1> Organization: Prohost.org MIME-Version: 1.0 Content-Disposition: inline Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Message-ID: <200401080915.31745.ilia@prohost.org> Subject: Re: [PHP-DEV] Ability to lower PHP memory usage From: ilia@prohost.org (Ilia Alshanetsky) 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