Req #76599 [Com]: php_strip_whitespace() is too slow
| From: | jhdxr@php.net | Date: | Tue, 17 Jul 2018 08:38:50 +0000 |
| Subject: | Req #76599 [Com]: php_strip_whitespace() is too slow | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-216362@lists.php.net to get a copy of this message | ||
Edit report at https://bugs.php.net/bug.php?id=76599&edit=1
ID: 76599
Comment by: jhdxr@php.net
Reported by: maggus dot staab+php at googlemail dot com
Summary: php_strip_whitespace() is too slow
Status: Open
Type: Feature/Change Request
Package: Performance problem
Operating System: win
PHP Version: 7.2.7
Block user comment: N
Private report: N
New Comment:
I tried to remove the buffering, and did a
[benchmark](https://gist.github.com/jhdxr/24c5b8017f3a80b22e2a23b7c01b6e70).
it has almost 30%+ improve on my CentOS. from about 0.650 to 0.400.
however, I cannot see any improvement on my Windows. the time remains about 0.600+.
I'm not sure if I should submit this patch, since I haven't cleaned up it yet.
Previous Comments:
------------------------------------------------------------------------
[2018-07-09 15:05:10] maggus dot staab+php at googlemail dot com
Description:
------------
in our composer workflows we see php_strip_whitespace() on the hotpath while running "composer
update".
in case time allows, it would be cool if someone could check the C implementation for possible low
hanging fruits?
https://blackfire.io/profiles/04234c24-b8c4-43b0-b23a-0a836b8c766e/graph
nikic suggested that the function could be faster by not using a outputbuffer:
"Currently it uses output buffering. Replacing that with a direct write to string would be the
most obvious improvement"
Expected result:
----------------
issue "blackfire run composer install" in your projects directory to get something like https://blackfire.io/profiles/04234c24-b8c4-43b0-b23a-0a836b8c766e/graph
------------------------------------------------------------------------
--
Edit this bug report at https://bugs.php.net/bug.php?id=76599&edit=1