title |
---|
Faker Comparisons |
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: {% filter compileAs('md') %}
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
{% endfilter %}
Each run includes creating a new Faker instance and generating a 1_000_000 values with the function returning a person's full name: {% filter compileAs('md') %}
fun main() {
List(10) { it }.sumOf {
measureTimeMillis {
val f = Faker()
repeat(1_000_000) { f.name.name() }
}
} / 10
}
{% endfilter %}
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
{% endinfo %}
{% filter compileAs('html') %}
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 | ||||||
{{ anchor(title='Available Data Providers', collectionType='wiki', collectionId='', itemId='Data Providers') }} (address , name , etc.) |
213 | 115 | 73 | 8 | 21 | 36 |
{{ anchor(title='Available Locales', collectionType='wiki', collectionId='', itemId='Available Locales') }} (nb-NO , uk , es etc.) |
60 | 51 | 47 | 10 | 46 | 44 |
{{ anchor(title='Generator of Unique Values', collectionType='wiki', collectionId='', itemId='Generator of Unique Values') }} | ✔ | ✗ | ✗ | ✗ | ✗ | ✗ |
{{ anchor(title='Extra Functionality', collectionType='wiki', collectionId='', itemId='Extras') }} | ✔ | ✔ | ✗ | ✔ | ✗ | ✗ |
{{ anchor(title='Kotlin DSL', collectionType='wiki', collectionId='', itemId='Faker DSL') }} | ✔ | ✗ | ✗ | ✗ | ✗ | ✗ |
{{ anchor(title='CLI App', collectionType='wiki', collectionId='', itemId='Faker Bot CLI') }} | ✔ | ✗ | ✗ | ✗ | ✗ | ✗ |
Actively maintained | ✔ | ✔ | ✗ | ✗ | ✔ | ✗ |
Benchmarks | v1.11.0 - 2890ms | v1.4.0 - 2950ms | v1.0.2 - 12500ms | v0.6.5 - 10300ms | NA | NA |