HomePhabricator

Improve the performance of tab replacement in common cases

Description

Improve the performance of tab replacement in common cases

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.

Reviewers: amckinley

Reviewed By: amckinley

Differential Revision: https://secure.phabricator.com/D20477

Details

Provenance
epriestleyAuthored on Apr 24 2019, 3:26 AM
epriestleyPushed on May 16 2019, 7:28 PM
Reviewer
amckinley
Differential Revision
D20477: Improve the performance of tab replacement in common cases
Parents
rPc5ecc388a212: Make branch status more clear on Diffusion branches view
Branches
Unknown
Tags
Unknown
Build Status
Buildable 22817
Build 31297: Run Core Tests