This patch reworks how cc_error_handler() in cc-debug.php handles ignoring errors triggered by certain libraries (PEAR, PHPTAL, and getID3). Before this patch, for every time that the cc_error_handler() was called, strpos() could be run up to three times. Now, the results of the strpos() checks are cached on a per-filename basis. The first time a PHP file triggers an error, the strpos() checks are cached, and any subsequent errors triggered by that file use the cached results, skipping strpos().
When loading the homepage on a brand new install on my laptop, strpos() was called 3451 times from cc_error_handler() before this patch. After the patch, it was called 199 times. These results were gathered using Xdebug/KCacheGrind.
Log in to post a comment.