Benchmarks for to compare the performance of well-known ORMs for Kotlin and Java versus Kotgres.
The benchmarks have the goal to be as unbiased as possible and to follow the docs to implement the benchmark functions.
PRs are welcome to add more ORMs or improve the performance of the existing ones.
For Java it includes:
- Hibernate
- Ebean
- Jooq
- ORMLite
For Kotlin it includes:
- Exposed
- Ktorm
- Kotgres
Make sure you have Docker installed. If not, you can install it here.
Follow the next steps:
- Bring up the local Postgres database by running
docker compose up -d - Open the file
java/io/kotgres/benchmarks/runner/BenchmarkRunner.kton your IDE - Right click on
BenchmarkRunner.ktand selectRun 'BenchmarkRunnerKt'(it can take up to 5 minutes with the default settings, be patient) - Wait for the benchmarks to finish and check the results in the console
The current top 3 looks like this: 🥇 Kotgres 🥈 ORMLite 🥉 Ebean
This is the output of that run on my local set up:
Kotgres (K): 0.53s (23.66x speed-up)
ORMLite (J): 0.57s (22.12x speed-up)
Ebean (J): 0.63s (19.94x speed-up)
JOOQ (J): 0.65s (19.31x speed-up)
Hibernate (J): 0.68s (18.55x speed-up)
Exposed (K): 6.73s (1.87x speed-up)
Ktorm (K): 12.59s (1.0x speed-up)