The new PHP time limit has brought attention to the fact that EchoDiscussionParser is slow. EchoDiscussionParser stands out as a common cause of PHP timeouts. For example, for https://www.wikidata.org/w/index.php?title=User:Wikidelo/books/To_fix&oldid=743563339 , EchoDiscussionParser took 211 seconds:
[0443][tstarling@mwmaint1001:~]$ mwscript eval.php --wiki=wikidatawiki > $rev = Revision::newFromId(743563339); > $t = microtime(true); EchoDiscussionParser::getChangeInterpretationForRevision($rev); print microtime(true)-$t; 211.43595385551
For comparison, the MediaWiki parser takes 3.8 seconds to parse this page.
The backtrace on timeout was:
#0 /srv/mediawiki/php-1.32.0-wmf.20/extensions/Echo/includes/DiscussionParser.php(682): NO_FUNCTION_GIVEN() #1 /srv/mediawiki/php-1.32.0-wmf.20/extensions/Echo/includes/DiscussionParser.php(598): EchoDiscussionParser::getFullSection() #2 /srv/mediawiki/php-1.32.0-wmf.20/extensions/Echo/includes/DiscussionParser.php(467): EchoDiscussionParser::interpretDiff(array, string, Title) #3 /srv/mediawiki/php-1.32.0-wmf.20/extensions/Echo/includes/DiscussionParser.php(37): EchoDiscussionParser::getChangeInterpretationForRevision(Revision) #4 /srv/mediawiki/php-1.32.0-wmf.20/extensions/Echo/includes/EchoHooks.php(525): EchoDiscussionParser::generateEventsForRevision(Revision, boolean) #5 /srv/mediawiki/php-1.32.0-wmf.20/includes/deferred/MWCallableUpdate.php(34): Closure$EchoHooks::onPageContentSaveComplete() #6 /srv/mediawiki/php-1.32.0-wmf.20/includes/deferred/DeferredUpdates.php(268): MWCallableUpdate->doUpdate() #7 /srv/mediawiki/php-1.32.0-wmf.20/includes/deferred/DeferredUpdates.php(214): DeferredUpdates::runUpdate(MWCallableUpdate, Wikimedia\Rdbms\LBFactoryMulti, string, integer) #8 /srv/mediawiki/php-1.32.0-wmf.20/includes/deferred/DeferredUpdates.php(134): DeferredUpdates::execute(array, string, integer) #9 /srv/mediawiki/php-1.32.0-wmf.20/includes/MediaWiki.php(914): DeferredUpdates::doUpdates(string) #10 /srv/mediawiki/php-1.32.0-wmf.20/includes/MediaWiki.php(734): MediaWiki->restInPeace(string, boolean) #11 [internal function]: Closure$MediaWiki::doPostOutputShutdown() #12 {main}
This is request ID W5XA4gpAAEsAAD5nA4IAAAAF.