Apache Commons CSV includes a Java Microbenchmark Harness (JMH) for testing various implementations of CSV processing.
The Skife CSV implementation is not available in Maven Central and therefore must be manually installed into the local Maven repository. Run the falling script to download and install the JAR file (~1MB).
./benchmark-prereq.sh
Benchmark Name | CSV Parser | Description |
---|---|---|
read | Java JDK | Use BufferedReader to perform a line count |
scan | Java JDK | Use Scanner to perform a line count |
split | Java JDK | Use BufferedReader to split each line on a delimiter |
parseCommonsCSV | commons-csv | Use CSVFormat to split each line on a delimiter |
parseGenJavaCSV | generation-java | Use CsvReader to split each line on a delimiter |
parseJavaCSV | java-csv | Use CsvReader to split each line on a delimiter |
parseOpenCSV | open-csv | Use CSVReader to split each line on a delimiter |
parseSkifeCSV | skife-csv | Use CSVReader to split each line on a delimiter |
parseSuperCSV | super-csv | Use CsvListReader to split each line on a delimiter |
# Run all benchmark tests
mvn test -Pbenchmark
# Run a specific benchmark test
mvn test -Pbenchmark -Dbenchmark=<name>
# Example of running basic "read" benchmark
mvn test -Pbenchmark -Dbenchmark=read
Apache Commons CSV includes a stand-alone performance test which only covers commons-csv.
# Run the performance test
mvn test -Dtest=PerformanceTest
⚠️ This performance test does not use JMH; it uses simple timing metrics.
CSV offers a secondary performance test harness located at: org.apache.commons.csv.PerformanceTest