Class ParseWorkload

java.lang.Object
org.antlr.v4.test.runtime.java.api.perf.jmh.ParseWorkload

public final class ParseWorkload extends Object
Shared parse/lex helpers for JMH and the comparative harness.

Threading model matches real multi-file front ends (Groovy, etc.):

  • Each worker owns its own lexer/parser (simulators are not shared across concurrent predictions).
  • DFA is stored on the static ATN and is therefore shared across workers when not cleared — the common "warm shared cache" case.
  • clearDfa forces ATN simulation on the hot path (stresses retained scratch, HPPC maps, hash cache, sparse clear).

Language-specific construction is a ParseWorkload.FrontEnd. Java and the compact Groovy-like grammar share parseSerial(java.util.List<org.antlr.v4.test.runtime.java.api.perf.jmh.CorpusLoader.SourceFile>, org.antlr.v4.test.runtime.java.api.perf.jmh.ParseWorkload.PredictionStrategy, boolean, boolean) / parseParallel(java.util.List<org.antlr.v4.test.runtime.java.api.perf.jmh.CorpusLoader.SourceFile>, org.antlr.v4.test.runtime.java.api.perf.jmh.ParseWorkload.PredictionStrategy, boolean, boolean, int) instead of copying the thread pool.