Tests for datafaker-net/datafaker#173
Exampe of running from cli
mvn clean package exec:exec -Dbenchmarks="DatafakerSimpleMethods" -Ddatafaker.version=2.2.3-SNAPSHOT
Or with different java version
mvn clean package exec:exec -Dbenchmarks="DatafakerSimpleMethods" -Ddatafaker.version=2.2.3-SNAPSHOT -Djava.version=21 -DexecutableJava=$JAVA_HOME/bin/java
The net.datafaker.benchmark.performance package covers fresh and reused Faker instances, shared and per-worker generation, locale fallback, and bulk Java, JSON, and CSV output.
For first-name, full-name, and street-address generation across the current Datafaker, Kotlin Faker, and JFairy builds, see the JVM faker comparison.
./mvnw clean package
java -jar target/benchmarks.jar -l 'net.datafaker.benchmark.performance'To compare unpublished revisions, install each revision from its Datafaker checkout with ./mvnw -PnoGpg -DskipTests install. Rebuild this benchmark project after each install with ./mvnw clean package -Ddatafaker.version=3.0.0-SNAPSHOT. Use the version from the Datafaker checkout if it differs, and use the same benchmark revision, JDK, and machine for each run.
java -jar target/benchmarks.jar 'performance.FakerBenchmark'java -jar target/benchmarks.jar \
'performance.(DefaultRandomBenchmark|LocaleLookupBenchmark|BulkGenerationBenchmark)' \
-bm avgt -tu ns -f 3 -wi 3 -i 4 -w 500ms -r 500ms \
-jvmArgs '-Xms512m -Xmx512m' -prof gc