Skip to content

Extremely poor performance #325

@marcinwyszynski

Description

@marcinwyszynski

I attempted to use Tailor to analyse this open-source app. After 10 minutes of maxing out my 4 cores JVM OOMed. I assume this is a limitation based on ANTLR-generated parser being used but I was wondering if you can think of some ways of improving performance by at least an order of magnitude? ;) I'm afraid I don't have much experience to provide meaningful input but one thing that limited memory consumption (to some 1.2GB) when I played around with the grammar was something like this:

private static ParseTree parseTreeFrom(String content) {
  CharStream input = new UnbufferedCharStream(new StringReader(content));
  SwiftLexer lex = new SwiftLexer(input);
  lex.setTokenFactory(new CommonTokenFactory(true));
  TokenStream tokens = new UnbufferedTokenStream<CommonToken>(lex);
  SwiftParser parser = new SwiftParser(tokens);
  parser.setTrimParseTree(true);
  return parser.topLevel();
}

That did not curb insane CPU usage, though. I'm wondering if you have any insights.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions