Page MenuHomePhabricator

Improve Remarkup parsing performance for certain large input blocks
ClosedPublic

Authored by epriestley on Feb 4 2020, 10:37 PM.
Tags
None
Referenced Files
F19612253: D20968.id.diff
Tue, Feb 3, 7:04 PM
F19522764: D20968.diff
Sat, Jan 17, 10:19 AM
F19520026: D20968.diff
Fri, Jan 16, 10:12 AM
F19517365: D20968.diff
Thu, Jan 15, 10:20 AM
F19515326: D20968.diff
Wed, Jan 14, 10:10 AM
F19083156: D20968.id49964.diff
Dec 2 2025, 12:31 PM
F18985323: D20968.id49962.diff
Nov 17 2025, 12:59 PM
F18887023: D20968.id.diff
Nov 7 2025, 5:29 AM
Subscribers
None

Details

Summary

Fixes T13487. In PHI1628, an install has a 4MB remarkup corpus which takes a long time to render. This is broadly expected, but a few reasonable improvements fell out of running it through the profiler.

Test Plan
  • Saw local cold-cache end-to-end rendering time drop from 12s to 4s for the highly secret input corpus.
  • Verified output has the same hashes before/after.
  • Ran all remarkup unit tests.

Diff Detail

Repository
rP Phabricator
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

src/infrastructure/markup/remarkup/PhutilRemarkupEngine.php
250–254

This piece was pretty wild. It meant "Are both blocks default blocks (plain old paragraphs)?" but tested that in a very convoluted way.

This revision was not accepted when it landed; it landed in state Needs Review.Feb 4 2020, 11:07 PM
This revision was automatically updated to reflect the committed changes.