Skip to content
This repository has been archived by the owner on Dec 1, 2024. It is now read-only.

Performance improvements, easier profiling, add `--hhvm-4.2-to-4.3` migration flag

Compare
Choose a tag to compare
@fredemmott fredemmott released this 30 Apr 16:15

This release:

  • improves performance of linting extremely large files with lots of lint errors by ~ 65%
  • adds the --xhprof-dot foo.dot parameter to hhast-lint, to generate a .dot file suitable for use with GraphViz
  • add --hhvm-4.2-to-4.3 to hhast-migrate as an alias of --ltgt-to-ne, replacing the <> operator with !=
  • fixes a race condition in the LSP server that could lead to a crash; crashes are extremely harmful to performance with a JIT runtime
  • added rewriteChildren() as a shallow alternative to rewriteDescendants()

Performance advice for linter authors

  • rewriting the AST is expensive; avoid if (fixed_node($in) !== $in) { raise_error() }-like code
  • prefer replace() over rewriteChildren() over rewriteDescendants() over rewrite()