This project is a benchmark suite for comparing different Java parser combinator libraries.
core: Contains the common interfaces for parsers (e.g.,CsvParser).benchmarks: The main module that runs performance tests on all implementations.dot-parse: Implementation using dot-parse.parseworks-impl: Implementation using parseworks.
Anybody can contribute a new implementation by following these steps:
- Create a new Maven submodule: Create a new directory and add a
pom.xmlthat inherits from the root project. - Add dependencies: Add the
coremodule as a dependency, along with your chosen parser library. - Implement the interface: Create a class that implements
io.github.parsercompare.TestParser. - Register as a Service: Create a file
src/main/resources/META-INF/services/io.github.parsercompare.TestParserin your module, and put the full name of your implementation class there. - Run benchmarks: Execute
mvn clean installfollowed byjava -jar benchmarks/target/benchmarks.jar. Thebenchmarks.jarwill automatically discover and test all implementations found on the classpath.
To run the current benchmarks:
mvn clean install
java -jar benchmarks/target/benchmarks.jar