Review main Merged

96813[TASK] Use native offsets for string scans

Wouter Wolters CR +2 V +2 Normal +67 −9 updated 10/18/26, 14:24

Commit message

Scan the original string with strcspn() offsets instead of copying the
remaining suffix with substr() before each scan. This avoids repeated
allocations in HtmlParser and ContentObjectRenderer, particularly for
long HTML with many tags or placeholders.

Keep the existing parsing logic and add regression coverage for empty
input, delimiter boundaries, incomplete tags and placeholders, Unicode
and binary content.

A PHP 8.5 benchmark with OPcache enabled measures 14% less time for
sanitized parseFunc() on 50 KiB of synthetic, tag-heavy HTML and 34%
less time at 200 KiB. Complete page requests were not measured.

Review

  • Code review CR +2 Done
    • Benni Mack +2
    • Oliver Klee +1
  • Verified V +2 Done
    • Benni Mack +2
    • Oliver Klee +1
    • core-ci +1 CI

Issues 1

Files 4

Review log 45

  1. Wouter Wolters uploaded patch set 1 10/18/26, 11:53

  2. core-ci voted on patch set 1 V +1 10/18/26, 12:00 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/111516

  3. Oliver Klee voted on patch set 1 CR +1 V +1 10/18/26, 12:04

  4. Benni Mack voted on patch set 1 CR +2 V +2 10/18/26, 14:24

  5. Benni Mack merged patch set 2 10/18/26, 14:24