title: ANTLR4 - Listeners are faster compared to Visitors?
body: <p>I am trying to parse java files using ANTLR4 and walk the parse tree searching for specific function calls.</p>
  
  <p>While I am able to achieve this using both <em>Visitor</em> and <em>Listener</em> approach, but stress tests reveals that Listeners are <strong>faster</strong> compared to Visitors, which goes contrary to popular belief.</p>
  
  <p>Theoretically, Visitors are supposed to be faster as they would only inspect specific node, where as listeners inspect all. Anyone know why this would be the case?</p>