When making repeated updates to a document, the Tag Processor will end
up copying the entire document once for every update. This can lead to
catastrophic behavior in the worse case.
However, when batch-applying updates it's able to copy chunks of the
document in one thread and only end up copying the entire document once
for the entire batch.
Previously the Tag Processor has been eagerly applying udpates, but in
this patch it defers applying those updates as long as is possible.
Developed in https://github.com/WordPress/wordpress-develop/pull/6120
Discussed in https://core.trac.wordpress.org/ticket/60697
Follow-up to [55706], [56941], [57348].
Reviewed by swissspidy.
Merges [57805] to the to the 6.5 branch.
Props dmsnell, bernhard-reiter, jonsurrell, westonruter.
Fixes#60697.
Built from https://develop.svn.wordpress.org/branches/6.5@57815
git-svn-id: http://core.svn.wordpress.org/branches/6.5@57316 1a063a9b-81f0-0310-95a4-ce76da25c4cd