Layout Thrashing Read/Write Interleave Warning

Observed operation trace potential forced-layout reads after caller confirmed invalidating writes; read assumed layout-dependent, no browser flush timing or elapsed cost inferred. Explicit supplied computed/layout context only; not a browser cascade/layout engine or cross-browser guarantee.

Description

A layout-dependent read after an invalidating write can require pending layout work.

A layout-dependent read after an invalidating write can require pending layout work.1

An annotated operation trace is a potential warning rather than a browser performance measurement. Use Layout Thrashing Read/Write Interleave Warning to evaluate the supplied inputs under the specific model below.

When to use Layout Thrashing Read/Write Interleave Warning

Use Layout Thrashing Read/Write Interleave Warning to evaluate the supplied inputs under the specific model below. Define the supplied layout, token or rendering scenario and establish the relevant units and browser context independently.

How to use Layout Thrashing Read/Write Interleave Warning and understand its results

  1. Define the supplied layout, token or rendering scenario and establish the relevant units and browser context independently.
  2. Enter Operation kinds, Caller layout invalidating flags using the field table and validation rules below, then run the tool.
  3. Read Potential forced layout read indices and interpret units, signs, ordering and placeholders as explained below.
  4. If the tool reports an input error, correct that field and rerun. A successful false result, empty match list or unknown-evidence placeholder has the specific meaning described here; check the limitations before applying the result.
Input fieldMeaningValue typeRequirement
operationKindsOperation kindsarray of stringRequired; constraints below
callerLayoutInvalidatingFlagsCaller layout invalidating flagsarray of numberRequired; constraints below

Enter aligned nonempty operation tokens write, read or other and binary layout-invalidating flags. Maintain a dirty flag, set only by a write with flag 1. A read while dirty is reported by its zero-based index and resets the flag; other operations leave it unchanged and read flags do not matter. The trace identifies modeled potential flushes rather than measuring actual forced reflow.

dirty write sets dirty; dirty read appends its index and clears dirty

Field order, units and branch conditions follow the implementation explanation above.

Output fieldMeaningValue type
potentialForcedLayoutReadIndicesPotential forced layout read indicesarray of number
json
{
  "input": {
    "operationKinds": [
      "write",
      "read",
      "read",
      "write",
      "read"
    ],
    "callerLayoutInvalidatingFlags": [
      1,
      0,
      0,
      1,
      0
    ]
  },
  "output": {
    "potentialForcedLayoutReadIndices": [
      1,
      4
    ]
  }
}

Limitations and assumptions

An annotated operation trace is a potential warning rather than a browser performance measurement. Apply the exact scope and assumptions described above.

All listed fields require explicit values. Unexpected fields, incorrect types, nonfinite numbers and sparse arrays fail validation. Domain-specific bounds, alignments and supported tokens are stated above; extremely large inputs or outputs can also be rejected. These errors differ from successful results such as false, no matches or unknown evidence.

Alternative or Complementary methods

Use Reflow vs Repaint Trigger Table for a related task: Property changes can invalidate different rendering stages.

Use content-visibility:auto Render Skip Note for a related task: Content visibility can allow a browser to skip eligible rendering work.

References

  1. Layout Thrashing Read/Write Interleave Warning — tool.io

Similar or alternative tools

Don't forget to set a bookmark for tool.io!
Privacy | Imprint | Cookies