Page MenuHomePhabricator

Improve the performance of tab replacement in common cases
ClosedPublic

Authored by epriestley on Apr 25 2019, 9:38 PM.
Tags
None
Referenced Files
F14100022: D20477.diff
Tue, Nov 26, 1:09 PM
F14096925: D20477.id48944.diff
Tue, Nov 26, 6:08 AM
F14096923: D20477.id48849.diff
Tue, Nov 26, 6:08 AM
F14096922: D20477.id.diff
Tue, Nov 26, 6:07 AM
F14096921: D20477.diff
Tue, Nov 26, 6:07 AM
Unknown Object (File)
Sun, Nov 24, 9:23 AM
Unknown Object (File)
Oct 20 2024, 4:02 PM
Unknown Object (File)
Oct 19 2024, 3:26 PM
Subscribers
None

Details

Summary

See PHI1210. For certain large inputs, we spend more time than we need to replacing tabs with spaces. Add some fast paths:

  • When a line only has tabs at the beginning of the line, we don't need to do as much work parsing the rest of the line.
  • When a line has no unicode characters, we don't need to vectorize it to get the right result.
Test Plan
  • Added test coverage.
  • Profiled this, got a ~60x performance increase on a 36,000 line 3MB text file.

Diff Detail

Repository
rP Phabricator
Branch
tabs1
Lint
Lint Passed
SeverityLocationCodeMessage
Advicesrc/applications/differential/parser/DifferentialChangesetParser.php:1459XHP16TODO Comment
Unit
Tests Passed
Build Status
Buildable 22724
Build 31150: Run Core Tests
Build 31149: arc lint + arc unit