[php-src] PR #25818: ext/uri: Optimize GHSA-mg3p-mxj9-g2mm tests
| From: | kocsismate | Date: | Fri, 27 Nov 2026 05:54:51 +0000 |
| Subject: | [php-src] PR #25818: ext/uri: Optimize GHSA-mg3p-mxj9-g2mm tests | ||
| Groups: | php.git-pulls | ||
| Request: | Send a blank email to git-pulls+get-41092@lists.php.net to get a copy of this message | ||
Pull Request: https://github.com/php/php-src/pull/25818
Author: kocsismate
Changing the input URI to a relative path reference makes the tests much faster, because uriparser
only increases a pointer when parsing each character in this case. On the other hand, it calls a
URI_FUNC(ParsePchar) function for each character while parsing the path of an absolute URI.
Additionally, the strspn() call is replaced with strcmp() because strspn() was also slow.
I tested the performance of my changes on Mac OS with ASAN, and the execution time of the first two
tests decreased by ~40%, while GHSA-mg3p-mxj9-g2mm-3.phpt decreased by ~70%.