On this page with about ~37K links ( https://ce.wikipedia.org/wiki/Декъашхо%3ATakhirgeran_Umar%2FНах_беха_меттигаш ), when you switch off the resource limit constraints, curl of this page on scandium times out with Parsoid/PHP whereas Parsoid/JS finishes in 24 seconds.
Flamegraph locally with parse.php shows WTUtils::reinsertFosterableContent and ProcessTreeBuilderFixups::deleteShadowMeta being the functions that take the most time.
Like some O(n^2) behavior.