Homec4science

Add an upstream JSON fragment lexer

Authored by epriestley <git@epriestley.com> on Oct 17 2015, 13:56.

Description

Add an upstream JSON fragment lexer

Summary: Ref T9566. This seems to be >100x faster than an older version of pygmentize for JSON inputs with a single long line. See discussion in D14273.

Test Plan:

  • Verified runtime improvement by comparing scripts/highlight.php on the one-line.json test case from D14273 with the new lexer enabled and commented out. Saw >10x local improvement. My local base runtime is also >10x better than the runtime from D14273. My laptop might be a little faster than whatever that hardware was, but this is probably mostly pygmentize improvements in my most recent version.
  • Added a test case.
  • Used the highlighter to produce reasonable-looking results:

{F883312}

Reviewers: chad, gd

Reviewed By: chad, gd

Maniphest Tasks: T9566

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

Details

Committed
epriestley <git@epriestley.com>Oct 17 2015, 13:56
Pushed
aubortMar 17 2017, 12:03
Parents
rPHUaee76238d694: Produce correct query strings from PhutilUri regardless of ini settings
Branches
Unknown
Tags
Unknown

Event Timeline

epriestley <git@epriestley.com> committed rPHUdb3667a62f66: Add an upstream JSON fragment lexer (authored by epriestley <git@epriestley.com>).Oct 17 2015, 13:56