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
Unknown Object (File)
Thu, Apr 11, 7:10 AM
Unknown Object (File)
Sat, Mar 30, 8:51 AM
Unknown Object (File)
Fri, Mar 29, 10:49 AM
Unknown Object (File)
Fri, Mar 29, 8:40 AM
Unknown Object (File)
Mar 14 2024, 6:05 PM
Unknown Object (File)
Feb 19 2024, 2:11 AM
Unknown Object (File)
Feb 17 2024, 5:20 PM
Unknown Object (File)
Feb 10 2024, 5:40 PM
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
Branch
remarkup1
Lint
Lint Passed
SeverityLocationCodeMessage
Advicesrc/infrastructure/markup/rule/PhabricatorObjectRemarkupRule.php:200XHP14Misuse of `preg_quote`
Advicesrc/infrastructure/markup/rule/PhabricatorObjectRemarkupRule.php:213XHP14Misuse of `preg_quote`
Unit
Tests Passed
Build Status
Buildable 23787
Build 32712: Run Core Tests
Build 32711: arc lint + arc unit

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.