T317070 and T215000 both dealt with non-linear performance of getElementsByTagName in PHP DOM's implementation.
The issue was reported upstream on May 24, 2023 and fixed in the master branch by Niels Dossche nine days later.
As a temporary workaround while we wait for PHP 8.3 to be released and deployed, Parsoid's DOMCompat::getElementsByTagName may be used instead. For projects that don't have Parsoid as a dependency, an equivalent XPath query may be used as a workaround.
Code search reveals Flow, DonationsInterface, Translate, GWToolset, TextExtracts all use this method (https://codesearch.wmcloud.org/search/?q=getElementsByTagName&i=nope&files=php&excludeFiles=)