Lafke

Benchmarks

How Lafke measures speed, memory, and detection accuracy, and how to repeat it.

Reproducible by design

The Lafke benchmarks measure the CLI and its analysis engine: speed and memory, and detection accuracy on public suites whose vulnerable and safe cases are labeled. Every measurement runs against source pinned to an exact commit, so anyone can repeat it and compare the numbers.

A fast run says nothing about what was found, so read speed and accuracy together.

Run it yourself

You need Go, git, and lafke with an engine installed. Run the commands from the root of the benchmarks repository.

go run ./cmd/bench                     # every corpus, with timing where it applies
go run ./cmd/bench -only juliet-java   # one corpus
go run ./cmd/bench -runs 0             # accuracy only, no timing
go run ./cmd/bench -list               # the corpus names

The program fetches each corpus at the revision recorded in corpora.json, fails if the checkout does not match it, and writes a JSON result.

Corpora

Corpus Source Scored how
OWASP Benchmark Java and Python versions of the OWASP Benchmark The rule of the case’s category reports in its file.
NIST Juliet The Java test cases of the Juliet Test Suite A finding with the CWE inside a bad or good method.
BenchProctor Standalone cases in Go, Java, JavaScript, PHP, Python, Ruby, and TypeScript A finding with the case’s CWE in its file.
Snyk VulnBench Fixtures with an attacker-reachable answer key A finding of the type near the source-to-sink flow.

The corpora are downloaded when you run the program and keep their own licenses.

What is measured

  • Speed: wall time of the whole command, including starting the engine, with one warm-up run and several timed runs.
  • Memory: the peak resident memory of lafke and the processes it started.
  • Accuracy: true positives, false positives, false negatives, and true negatives, and from them recall, precision, F1, and Youden’s J.

Every label counts, including a case Lafke could not analyze. A unit that does not finish in time has no findings, so its vulnerable cases count as false negatives.

Read the scores with care

  • Most suites are synthetic, and their mix of vulnerable and safe cases differs from a real repository. The scores do not predict accuracy on an arbitrary application.
  • Lafke’s analysis is developed against suites like these, so this is not a held-out evaluation.
  • Some corpora are scored by Lafke’s own reading of the answer key, or with groups of related CWEs. Those numbers are not comparable with the official scorers.
  • A score only means something next to another tool that ran on the same revisions and the same cases, scored the same way.
  • Shared CI runners are noisy. Compare runs of the same workflow with each other, not with your own machine.

Results

A GitHub Actions workflow runs the benchmarks every Monday. Each corpus runs on its own runner, and the results are in the job summary and in a downloadable artifact.


The method, the scoring rules, and how to add a corpus are in the benchmarks repository.