Re: cvs: /php3 ChangeLog /php3/functions file.c php3_string.h
| From: | Rasmus Lerdorf | Date: | Thu, 01 Jan 1970 00:00:00 +0000 |
| Subject: | Re: cvs: /php3 ChangeLog /php3/functions file.c php3_string.h | ||
| References: | 1 | Groups: | php.dev |
| Request: | Send a blank email to php-dev+get-11118@lists.php.net to get a copy of this message | ||
> > A full 12K of object code for this? The logic I added to strip_tags
> > probably amounted to less than 500 bytes and it does the same thing.
>
> Did you check that? Objects have a fairly big header and added
> information.
True, without the header and other crap it is 7832 bytes.
> Also remember that the type of code you're playing with is extremely prone
> to bugs (before your addition and especially after it), whereas flex
> generated code is rock solid and very easily modified. It's usually worth
> the few added kilobytes.
True. But there is a line somewhere or all string manipulation would be
done with flex. It just depends on where you draw that line and whether
you think a particular piece of code is likely to need new additions. The
tag-stripping state machine may be getting close to that line, but in my
opinion it isn't there yet.
The flex version of the same code also eats a whole lot more memory when
it runs. I do agree with you that a flex-based parser has a bunch of
advantages that make some code-size, speed and memory drawbacks
worthwhile.
-Rasmus