class NGramLangIdentifierPerformanceTest {

  private static final File ngramZip = new File("/home/languagetool/ngram-lang-id/model_ml50_new.zip");
  private static final Path input = Paths.get("/home/dnaber/data/corpus/tatoeba/20191014/sentences_shuf.txt");
  private static final int limit = 10_000;

  public void testPerformance() throws IOException {<FILL_FUNCTION_BODY>}

  public static void main(String[] args) throws IOException {
    new NGramLangIdentifierPerformanceTest().testPerformance();
  }

}

    System.out.println("Loading ngrams...");
    NGramDetector ngram = new NGramDetector(ngramZip, 50);
    System.out.println("Loaded.");
    int i = 0;
    double totalMillis = 0;
    long totalLength = 0;
    long totalRuns = 0;
    System.out.println("Loading input...");
    List<String> lines = Files.readAllLines(input);
    System.out.println("Loaded " + lines.size() + " lines.");
    for (String line : lines) {
      long startTime = System.nanoTime();
      Map<String, Double> detectLanguages = ngram.detectLanguages(line, null);
      long endTime = System.nanoTime();
      double runTimeMillis = (endTime - startTime) / 1000.0f / 1000.0f;
      if (i > 10) {
        totalMillis += runTimeMillis;
        totalLength += line.length();
        totalRuns++;
        //System.out.println(line.length() + " chars took " + runTimeMillis + "ms -> " + detectLanguages);
        //System.out.println(line.length() + " chars took " + runTimeMillis + "ms");
        if (runTimeMillis > 5) {
          System.out.println(line.length() + " chars took " + runTimeMillis + "ms for text: " + line);
        }
      } else {
        System.out.println("Skipping early run " + i);
      }
      if (i > limit) {
        System.out.println("Stopping test at limit " + limit);
        break;
      }
      i++;
    }
    System.out.println("Runs: " + totalRuns);
    System.out.printf(Locale.ENGLISH, "Avg. length: %.2f chars\n", (double)totalLength/totalRuns);
    System.out.printf(Locale.ENGLISH, "Avg: %.2fms\n", totalMillis/totalRuns);
  
<no_super_class>