JVM-targeted Faker Libs Comparison
On the surface kotlin-faker isn't "unique" by any means and there exist other JVM-targeted libraries out there with similar functionalities, so you have several options to choose from.
So why use this one instead? I've decided to make a comparison between kotlin-faker, and other JVM-based libs that have been out there for quite some time.
info
The benchmarks time is an average execution time of 10 consecutive runs on the system with the following specs:
OS: Ubuntu 20.04.4 LTS x86_64
Host: Precision 5530
Kernel: 5.13.0-41-generic
CPU: Intel i9-8950HK (12) @ 4.800GHz
GPU: NVIDIA Quadro P2000 Mobile
GPU: Intel UHD Graphics 630
Memory: 21277MiB / 31728MiB
Each run includes creating a new Faker instance and generating a 1_000_000 values with the function returning a person's full name:
fun main() {
List(10) { it }.sumOf {
measureTimeMillis {
val f = Faker()
repeat(1_000_000) { f.name.name() }
}
} / 10
}
Note: benchmarks for `blocoio/faker` could not be done due to unexpected exceptions coming from the lib, benchmarks for `moove-it/fakeit` could not be done due to android dependencies in the lib
kotlin-faker | datafaker-net/datafaker | DiUS/java-faker | Devskiller/jfairy | blocoico/faker | moove-it/fakeit | |
---|---|---|---|---|---|---|
kotlin-faker | datafaker-net/datafaker | DiUS/java-faker | Devskiller/jfairy | blocoico/faker | moove-it/fakeit | |
Language | ||||||
Available Data Providers (address , name , etc.) |
213 | 115 | 73 | 8 | 21 | 36 |
Available Locales (nb-NO , uk , es etc.) |
60 | 51 | 47 | 10 | 46 | 44 |
Generator of Unique Values | ✔ | ✗ | ✗ | ✗ | ✗ | ✗ |
Extra Functionality | ✔ | ✔ | ✗ | ✔ | ✗ | ✗ |
Kotlin DSL | ✔ | ✗ | ✗ | ✗ | ✗ | ✗ |
CLI App | ✔ | ✗ | ✗ | ✗ | ✗ | ✗ |
Actively maintained | ✔ | ✔ | ✗ | ✗ | ✔ | ✗ |
Benchmarks | v1.11.0 - 2890ms | v1.4.0 - 2950ms | v1.0.2 - 12500ms | v0.6.5 - 10300ms | NA | NA |