[PATCH] parse_url rewrite
| From: | Ilia A. | Date: | Sun, 06 Oct 2002 01:23:11 +0000 |
| Subject: | [PATCH] parse_url rewrite | ||
| Groups: | php.dev | ||
| Request: | Send a blank email to php-dev+get-89068@lists.php.net to get a copy of this message | ||
As clearly demonstrated buy bug report #16545, the current implementation of
parse_url() function is extremely slow. I wrote a custom state machine parser
to do the parsing in the place of the current regular expression.
The result is code that takes a fraction of the time to run and in addition to
running faster, resolves some bugs in the existing implementation of the
parse_url() function.
I've tested the code using a parse_url() test created by Derick, which can be
found at php4/ext/standard/tests/strings/url_t.phpt. The new code passes the
test admirably and is in excess of 30 times faster then the existing
implementation.
Please try the attached patch and let me know if there are any objections to
replacing the current parse_url implementation with the one I propose.
Ilia