Make WordPress Core

Opened 3 months ago

Closed 3 months ago

Last modified 3 months ago

#60697 closed defect (bug) (fixed)

HTML API: Defer applying updates until necessary.

Reported by: dmsnell's profile dmsnell Owned by: audrasjb's profile audrasjb
Milestone: 6.5 Priority: normal
Severity: normal Version: 6.3
Component: HTML API Keywords: has-patch has-unit-tests dev-reviewed fixed-major
Focuses: Cc:

Description

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 runtime behavior in the worse case.

However, when batch-applying updates it's able to copy chunks of the
document in one go and only end up copying the entire document once
for the entire batch.

Previously the Tag Processor has been eagerly applying updates, but in
this patch it defers applying those updates as long as is possible.

Change History (10)

This ticket was mentioned in PR #6120 on WordPress/wordpress-develop by @dmsnell.


3 months ago
#1

  • Keywords has-patch has-unit-tests added

Trac ticket: Core-60697

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 updates, but in
this patch it defers applying those updates as long as is possible.

This ticket was mentioned in Slack in #core-performance by dmsnell. View the logs.


3 months ago

#3 @swissspidy
3 months ago

  • Version changed from trunk to 6.3

Setting version to 6.3 because it was indicated on Slack that this might have been introduced in [55706].

#4 @dmsnell
3 months ago

  • Owner set to dmsnell
  • Resolution set to fixed
  • Status changed from new to closed

In 57805:

HTML API: Defer applying attribute updates until necessary.

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

Props: dmsnell, bernhard-reiter, jonsurrell, westonruter.
Fixes #60697.
Follow-up to [55706], [56941], [57348].

#5 @dmsnell
3 months ago

  • Keywords dev-feedback added
  • Milestone changed from Awaiting Review to 6.5
  • Resolution fixed deleted
  • Status changed from closed to reopened

Re-opening for back-port to 6.5.

#7 @swissspidy
3 months ago

  • Keywords dev-reviewed fixed-major added; dev-feedback removed

#8 @audrasjb
3 months ago

  • Owner changed from dmsnell to audrasjb
  • Status changed from reopened to assigned

Self assigning for 6.5 backport before RC2 commit freeze :)

#9 @audrasjb
3 months ago

  • Resolution set to fixed
  • Status changed from assigned to closed

In 57815:

HTML API: Defer applying attribute updates until necessary.

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.

#10 @dmsnell
3 months ago

Thank you @audrasjb !

Note: See TracTickets for help on using tickets.