Open mozeryansky opened 1 year ago
I didn't have Docker running, but I still can't get it to run. I started Docker and ran start again. On the second attempt there was a new error, which required me to stop/kill all the docker containers to try again.
Attemp 1:
~/tmp/drizzle-northwind-benchmarks-pg (main) $ pnpm run start
> drizzle_pg_benchmarks@1.0.0 start /Users/michael/tmp/drizzle-northwind-benchmarks-pg
> pnpm run prepare:prisma && tsx src/common/benchmark
> drizzle_pg_benchmarks@1.0.0 prepare:prisma /Users/michael/tmp/drizzle-northwind-benchmarks-pg
> npx prisma generate --schema src/prisma/schema.prisma
Environment variables loaded from .env
Prisma schema loaded from src/prisma/schema.prisma
warn Preview feature "referentialIntegrity" is deprecated. The functionality can be used without specifying it as a preview feature.
✔ Generated Prisma Client (4.16.2 | library) to ./node_modules/@prisma/client in 200ms
You can now start using Prisma Client in your code. Reference: https://pris.ly/d/client
\```
import { PrismaClient } from '@prisma/client'
const prisma = new PrismaClient()
\```
(node:67871) ExperimentalWarning: Custom ESM Loaders is an experimental feature and might change at any time
(Use `node --trace-warnings ...` to show where the warning was created)
localhost postgres postgres postgres undefined
55002
Cannot connect to Postgres
/Users/michael/tmp/drizzle-northwind-benchmarks-pg/node_modules/pg/lib/client.js:132
const error = this._ending ? new Error('Connection terminated') : new Error('Connection terminated unexpectedly')
^
Error: Connection terminated unexpectedly
at Connection.<anonymous> (/Users/michael/tmp/drizzle-northwind-benchmarks-pg/node_modules/pg/lib/client.js:132:73)
at Object.onceWrapper (node:events:627:28)
at Connection.emit (node:events:513:28)
at Connection.emit (node:domain:489:12)
at Socket.<anonymous> (/Users/michael/tmp/drizzle-northwind-benchmarks-pg/node_modules/pg/lib/connection.js:107:12)
at Socket.emit (node:events:525:35)
at Socket.emit (node:domain:489:12)
at endReadableNT (node:internal/streams/readable:1359:12)
at process.processTicksAndRejections (node:internal/process/task_queues:82:21)
Node.js v18.13.0
ELIFECYCLE Command failed with exit code 1.
```
Attempt 2:
```
~/tmp/drizzle-northwind-benchmarks-pg (main) $ pnpm run start
> drizzle_pg_benchmarks@1.0.0 start /Users/michael/tmp/drizzle-northwind-benchmarks-pg
> pnpm run prepare:prisma && tsx src/common/benchmark
> drizzle_pg_benchmarks@1.0.0 prepare:prisma /Users/michael/tmp/drizzle-northwind-benchmarks-pg
> npx prisma generate --schema src/prisma/schema.prisma
Environment variables loaded from .env
Prisma schema loaded from src/prisma/schema.prisma
warn Preview feature "referentialIntegrity" is deprecated. The functionality can be used without specifying it as a preview feature.
✔ Generated Prisma Client (4.16.2 | library) to ./node_modules/@prisma/client in 194ms
You can now start using Prisma Client in your code. Reference: https://pris.ly/d/client
\```
import { PrismaClient } from '@prisma/client'
const prisma = new PrismaClient()
\```
(node:67923) ExperimentalWarning: Custom ESM Loaders is an experimental feature and might change at any time
(Use `node --trace-warnings ...` to show where the warning was created)
localhost postgres postgres postgres undefined
55002
/Users/michael/tmp/drizzle-northwind-benchmarks-pg/node_modules/docker-modem/lib/modem.js:336
var msg = new Error(
^
Error: (HTTP code 500) server error - driver failed programming external connectivity on endpoint benchmarks-tests-e208aeb2-0267-486e-87ef-94d4246ddacc (8cfa84eab1f8975de4eeb512520ed50c67fb32ea011d9633ebc8345f58c2d0bd): Bind for 0.0.0.0:55001 failed: port is already allocated
at <anonymous> (/Users/michael/tmp/drizzle-northwind-benchmarks-pg/node_modules/docker-modem/lib/modem.js:336:17)
at getCause (/Users/michael/tmp/drizzle-northwind-benchmarks-pg/node_modules/docker-modem/lib/modem.js:366:7)
at Object.Modem.buildPayload (/Users/michael/tmp/drizzle-northwind-benchmarks-pg/node_modules/docker-modem/lib/modem.js:335:5)
at IncomingMessage.<anonymous> (/Users/michael/tmp/drizzle-northwind-benchmarks-pg/node_modules/docker-modem/lib/modem.js:303:16)
at IncomingMessage.emit (node:events:525:35)
at IncomingMessage.emit (node:domain:489:12)
at endReadableNT (node:internal/streams/readable:1359:12)
at process.processTicksAndRejections (node:internal/process/task_queues:82:21) {
reason: 'server error',
statusCode: 500,
json: {
message: 'driver failed programming external connectivity on endpoint benchmarks-tests-e208aeb2-0267-486e-87ef-94d4246ddacc (8cfa84eab1f8975de4eeb512520ed50c67fb32ea011d9633ebc8345f58c2d0bd): Bind for 0.0.0.0:55001 failed: port is already allocated'
}
}
Node.js v18.13.0
ELIFECYCLE Command failed with exit code 1.
@mozeryansky Check my fork in rqb-patch-1
or #2, I made it works.
I still have the issue when using your branch:
$ pnpm run start
...
localhost postgres postgres postgres undefined
55002
Cannot connect to Postgres
...
And a different error on a second run:
$ pnpm run start
...
localhost postgres postgres postgres undefined
55002
/Users/michael/tmp/drizzle-northwind-benchmarks-pg/node_modules/.pnpm/docker-modem@3.0.8/node_modules/docker-modem/lib/modem.js:343
var msg = new Error(
^
Error: (HTTP code 500) server error - driver failed programming external connectivity on endpoint benchmarks-tests-daf95ed0-b7f8-4c2f-8b25-8ffb1a357d92 (346eee8973941cd1be05d8a7efbba413e58e42ef4e9867a7031584a018549cb0): Bind for 0.0.0.0:55000 failed: port is already allocated
...
```
I figured out the issue, it was because my Docker was set to 1 CPU. I wrote a test script to create one docker and connect/query and it worked fine, but after 3 it was failing. Increasing the timeout worked, so when I described the issue to ChatGPT it suggested increasing the CPU.
In my opinion this kind of benchmark is very unreliable, as my production server isn't running 9 concurrent PostgreSQL instances. Instead of testing a query against all ORMs, it should use one ORM against one database to test all queries. And preferably connect to a service like PlanetScale/Supabase to get real world metrics. The benchmark also does not cleanup the docker if there's an issue so I made this function for cleanup:
clean_docker () {
docker rm -f $(docker ps -a -q)
docker volume rm $(docker volume ls -q)
}
Below is the result with Docker using 8 CPUs and 8 Gb. Using docker stats
shows it never exceeded 20% of cpu or memory, but the script does require all docker containers to be running concurrently.
cpu: Intel(R) Core(TM) i7-6920HQ CPU @ 2.90GHz
runtime: node v20.3.0 (x64-darwin)
benchmark time (avg) (min … max) p75 p99 p995
------------------------------------------------- -----------------------------
• select * from customer
------------------------------------------------- -----------------------------
pg 1.67 ms/iter (1.27 ms … 7.73 ms) 1.68 ms 4.48 ms 5.7 ms
pg:p 1.55 ms/iter (1.18 ms … 2.97 ms) 1.62 ms 2.49 ms 2.83 ms
drizzle 1.82 ms/iter (1.4 ms … 2.96 ms) 1.97 ms 2.84 ms 2.95 ms
drizzle:p 1.61 ms/iter (1.21 ms … 4.11 ms) 1.7 ms 3.12 ms 3.55 ms
knex 1.54 ms/iter (1.24 ms … 2.6 ms) 1.63 ms 2.13 ms 2.5 ms
kysely 1.54 ms/iter (1.2 ms … 4.9 ms) 1.58 ms 3.29 ms 3.94 ms
mikro 3.37 ms/iter (2.24 ms … 13.35 ms) 3.64 ms 6.69 ms 13.35 ms
typeorm 2.51 ms/iter (1.9 ms … 3.98 ms) 2.73 ms 3.51 ms 3.54 ms
prisma 3 ms/iter (2.49 ms … 5.68 ms) 3.08 ms 5.03 ms 5.68 ms
summary for select * from customer
kysely
1x faster than knex
1x faster than pg:p
1.04x faster than drizzle:p
1.08x faster than pg
1.18x faster than drizzle
1.63x faster than typeorm
1.95x faster than prisma
2.19x faster than mikro
• select * from customer where id = ?
------------------------------------------------- -----------------------------
pg 110.52 ms/iter (97.03 ms … 166.87 ms) 110.23 ms 166.87 ms 166.87 ms
pg:p 100.04 ms/iter (87.12 ms … 131.83 ms) 104.9 ms 131.83 ms 131.83 ms
drizzle 116.65 ms/iter (100.84 ms … 140.89 ms) 130.88 ms 140.89 ms 140.89 ms
drizzle:p 96.69 ms/iter (85.92 ms … 131.03 ms) 99.44 ms 131.03 ms 131.03 ms
knex 113.35 ms/iter (94.9 ms … 142.57 ms) 117.51 ms 142.57 ms 142.57 ms
kysely 112.77 ms/iter (99.12 ms … 162.77 ms) 116.84 ms 162.77 ms 162.77 ms
mikro 142.5 ms/iter (110.8 ms … 207.53 ms) 142.45 ms 207.53 ms 207.53 ms
typeorm 134.22 ms/iter (113.84 ms … 180.22 ms) 135.81 ms 180.22 ms 180.22 ms
prisma 155.75 ms/iter (136.19 ms … 209.53 ms) 165.55 ms 209.53 ms 209.53 ms
summary for select * from customer where id = ?
drizzle:p
1.03x faster than pg:p
1.14x faster than pg
1.17x faster than kysely
1.17x faster than knex
1.21x faster than drizzle
1.39x faster than typeorm
1.47x faster than mikro
1.61x faster than prisma
• select * from customer where company_name ilike ?
------------------------------------------------- -----------------------------
pg 64.26 ms/iter (58.49 ms … 81.94 ms) 65.71 ms 81.94 ms 81.94 ms
pg:p 75.85 ms/iter (55.33 ms … 302.2 ms) 61.39 ms 302.2 ms 302.2 ms
drizzle 69.19 ms/iter (59.81 ms … 84.04 ms) 72.95 ms 84.04 ms 84.04 ms
drizzle:p 60.71 ms/iter (54.9 ms … 77.14 ms) 61.34 ms 77.14 ms 77.14 ms
knex 68.49 ms/iter (62.56 ms … 94.99 ms) 69.31 ms 94.99 ms 94.99 ms
kysely 68.96 ms/iter (59.7 ms … 82.24 ms) 75.06 ms 82.24 ms 82.24 ms
mikro 79.95 ms/iter (64.03 ms … 101.98 ms) 91.01 ms 101.98 ms 101.98 ms
typeorm 80.71 ms/iter (69.07 ms … 103.55 ms) 86.02 ms 103.55 ms 103.55 ms
prisma 118.26 ms/iter (86.28 ms … 168.31 ms) 132.29 ms 168.31 ms 168.31 ms
summary for select * from customer where company_name ilike ?
drizzle:p
1.06x faster than pg
1.13x faster than knex
1.14x faster than kysely
1.14x faster than drizzle
1.25x faster than pg:p
1.32x faster than mikro
1.33x faster than typeorm
1.95x faster than prisma
• "SELECT * FROM employee"
------------------------------------------------- -----------------------------
pg 2.63 ms/iter (1.09 ms … 9.98 ms) 3.18 ms 9.41 ms 9.7 ms
pg:p 2.16 ms/iter (1.16 ms … 41.51 ms) 2.18 ms 6.77 ms 7.07 ms
drizzle 4.23 ms/iter (1.71 ms … 23.04 ms) 4.45 ms 22.93 ms 23.04 ms
drizzle:p 2.93 ms/iter (1.24 ms … 38.54 ms) 2.93 ms 18.74 ms 38.54 ms
knex 3.14 ms/iter (1.59 ms … 14.2 ms) 3.07 ms 13.51 ms 14.2 ms
kysely 3.69 ms/iter (1.6 ms … 20.19 ms) 3.74 ms 18.56 ms 20.19 ms
mikro 4.24 ms/iter (2.28 ms … 12.5 ms) 4.63 ms 9.54 ms 12.5 ms
typeorm 3.56 ms/iter (1.68 ms … 14.61 ms) 3.89 ms 13.85 ms 14.61 ms
prisma 3 ms/iter (1.62 ms … 8 ms) 3.6 ms 6.22 ms 8 ms
summary for "SELECT * FROM employee"
pg:p
1.21x faster than pg
1.36x faster than drizzle:p
1.39x faster than prisma
1.45x faster than knex
1.64x faster than typeorm
1.71x faster than kysely
1.96x faster than drizzle
1.96x faster than mikro
• select * from employee where id = ? left join reportee
------------------------------------------------- -----------------------------
pg 20.61 ms/iter (10.86 ms … 201.78 ms) 17.64 ms 201.78 ms 201.78 ms
pg:p 15.03 ms/iter (9.17 ms … 32.84 ms) 16.44 ms 32.84 ms 32.84 ms
drizzle 25.88 ms/iter (15.55 ms … 51.81 ms) 29.75 ms 51.81 ms 51.81 ms
drizzle:p 14.11 ms/iter (9.35 ms … 31.65 ms) 15.4 ms 31.65 ms 31.65 ms
knex 37.65 ms/iter (21.24 ms … 70.64 ms) 42.44 ms 70.64 ms 70.64 ms
kysely 21.37 ms/iter (14.66 ms … 41 ms) 24.06 ms 41 ms 41 ms
mikro 20.21 ms/iter (14.7 ms … 30.04 ms) 21.61 ms 30.04 ms 30.04 ms
typeorm 36.17 ms/iter (29.89 ms … 48.37 ms) 36.85 ms 48.37 ms 48.37 ms
prisma 33.81 ms/iter (25.45 ms … 54.22 ms) 37.61 ms 54.22 ms 54.22 ms
summary for select * from employee where id = ? left join reportee
drizzle:p
1.07x faster than pg:p
1.43x faster than mikro
1.46x faster than pg
1.52x faster than kysely
1.83x faster than drizzle
2.4x faster than prisma
2.56x faster than typeorm
2.67x faster than knex
• SELECT * FROM supplier
------------------------------------------------- -----------------------------
pg 1.58 ms/iter (1.03 ms … 5.76 ms) 1.79 ms 3.44 ms 4.34 ms
pg:p 1.21 ms/iter (927.62 µs … 2.12 ms) 1.28 ms 1.8 ms 1.87 ms
drizzle 1.69 ms/iter (1.02 ms … 5.14 ms) 1.92 ms 3.54 ms 4.19 ms
drizzle:p 1.41 ms/iter (994.6 µs … 3.37 ms) 1.51 ms 2.86 ms 2.92 ms
knex 1.82 ms/iter (1.07 ms … 3.8 ms) 2.03 ms 3.13 ms 3.56 ms
kysely 1.49 ms/iter (1.09 ms … 3.16 ms) 1.63 ms 2.71 ms 2.92 ms
mikro 2.72 ms/iter (1.66 ms … 6.72 ms) 3.05 ms 5.87 ms 6.72 ms
typeorm 2.3 ms/iter (1.45 ms … 17.63 ms) 2.37 ms 13.88 ms 16.33 ms
prisma 2.1 ms/iter (1.65 ms … 3.34 ms) 2.19 ms 3.08 ms 3.33 ms
summary for SELECT * FROM supplier
pg:p
1.17x faster than drizzle:p
1.23x faster than kysely
1.3x faster than pg
1.4x faster than drizzle
1.5x faster than knex
1.74x faster than prisma
1.9x faster than typeorm
2.25x faster than mikro
• select * from supplier where id = ?
------------------------------------------------- -----------------------------
pg 47.05 ms/iter (40.22 ms … 56.69 ms) 49.12 ms 56.69 ms 56.69 ms
pg:p 37.91 ms/iter (30.36 ms … 63.37 ms) 39.15 ms 63.37 ms 63.37 ms
drizzle 43.07 ms/iter (34 ms … 59.64 ms) 50.42 ms 59.64 ms 59.64 ms
drizzle:p 33.25 ms/iter (28.91 ms … 44.66 ms) 36.28 ms 44.66 ms 44.66 ms
knex 40.31 ms/iter (33.98 ms … 59.64 ms) 44.5 ms 59.64 ms 59.64 ms
kysely 43.19 ms/iter (34.95 ms … 62.04 ms) 47.75 ms 62.04 ms 62.04 ms
mikro 54.98 ms/iter (43.59 ms … 74.89 ms) 59.37 ms 74.89 ms 74.89 ms
typeorm 52.61 ms/iter (40.28 ms … 77.23 ms) 55.34 ms 77.23 ms 77.23 ms
prisma 53.17 ms/iter (48.11 ms … 72.49 ms) 56.24 ms 72.49 ms 72.49 ms
summary for select * from supplier where id = ?
drizzle:p
1.14x faster than pg:p
1.21x faster than knex
1.3x faster than drizzle
1.3x faster than kysely
1.41x faster than pg
1.58x faster than typeorm
1.6x faster than prisma
1.65x faster than mikro
• SELECT * FROM product
------------------------------------------------- -----------------------------
pg 1.57 ms/iter (1.17 ms … 2.61 ms) 1.67 ms 2.47 ms 2.53 ms
pg:p 1.89 ms/iter (1.2 ms … 5.1 ms) 2.04 ms 3.92 ms 3.95 ms
drizzle 2.06 ms/iter (1.35 ms … 3.57 ms) 2.34 ms 3.27 ms 3.44 ms
drizzle:p 1.81 ms/iter (1.24 ms … 6.35 ms) 1.95 ms 4.73 ms 5.69 ms
knex 1.71 ms/iter (1.31 ms … 3.18 ms) 1.83 ms 2.92 ms 3.03 ms
kysely 1.7 ms/iter (1.15 ms … 4.45 ms) 1.87 ms 2.92 ms 3.06 ms
mikro 3.52 ms/iter (2.71 ms … 8.77 ms) 3.6 ms 8.32 ms 8.77 ms
typeorm 1.94 ms/iter (1.67 ms … 3.92 ms) 1.98 ms 3.04 ms 3.46 ms
prisma 3 ms/iter (2.37 ms … 7.09 ms) 3.24 ms 4.82 ms 7.09 ms
summary for SELECT * FROM product
pg
1.08x faster than kysely
1.09x faster than knex
1.15x faster than drizzle:p
1.21x faster than pg:p
1.24x faster than typeorm
1.32x faster than drizzle
1.92x faster than prisma
2.25x faster than mikro
• SELECT * FROM product LEFT JOIN supplier WHERE product.id = ?
------------------------------------------------- -----------------------------
pg 106.66 ms/iter (93.68 ms … 132.87 ms) 110.18 ms 132.87 ms 132.87 ms
pg:p 82.11 ms/iter (71.34 ms … 104.12 ms) 82.54 ms 104.12 ms 104.12 ms
drizzle 131.79 ms/iter (105.26 ms … 227.54 ms) 135.11 ms 227.54 ms 227.54 ms
drizzle:p 95.85 ms/iter (80.99 ms … 229.67 ms) 88.87 ms 229.67 ms 229.67 ms
knex 110.56 ms/iter (100.48 ms … 129.08 ms) 120.56 ms 129.08 ms 129.08 ms
kysely 112.98 ms/iter (104.18 ms … 136.33 ms) 114.82 ms 136.33 ms 136.33 ms
mikro 169.56 ms/iter (150.86 ms … 213.16 ms) 176.32 ms 213.16 ms 213.16 ms
typeorm 319.25 ms/iter (289.33 ms … 348.8 ms) 329.27 ms 348.8 ms 348.8 ms
prisma 227.01 ms/iter (192.04 ms … 268.14 ms) 262.87 ms 268.14 ms 268.14 ms
summary for SELECT * FROM product LEFT JOIN supplier WHERE product.id = ?
pg:p
1.17x faster than drizzle:p
1.3x faster than pg
1.35x faster than knex
1.38x faster than kysely
1.6x faster than drizzle
2.06x faster than mikro
2.76x faster than prisma
3.89x faster than typeorm
• SELECT * FROM product WHERE product.name ILIKE ?
------------------------------------------------- -----------------------------
pg 70.14 ms/iter (61.23 ms … 95.7 ms) 74.26 ms 95.7 ms 95.7 ms
pg:p 58.24 ms/iter (52.68 ms … 70.28 ms) 60.08 ms 70.28 ms 70.28 ms
drizzle 74.32 ms/iter (65.93 ms … 93.31 ms) 76.15 ms 93.31 ms 93.31 ms
drizzle:p 68.69 ms/iter (56.68 ms … 94.16 ms) 77.28 ms 94.16 ms 94.16 ms
knex 121.17 ms/iter (75.15 ms … 217.72 ms) 144.33 ms 217.72 ms 217.72 ms
kysely 121.98 ms/iter (79.12 ms … 185.13 ms) 137.16 ms 185.13 ms 185.13 ms
mikro 117.7 ms/iter (91.6 ms … 183.02 ms) 131.39 ms 183.02 ms 183.02 ms
typeorm 101.25 ms/iter (77.52 ms … 135.57 ms) 116.96 ms 135.57 ms 135.57 ms
prisma 120.28 ms/iter (94.5 ms … 211.39 ms) 127.1 ms 211.39 ms 211.39 ms
summary for SELECT * FROM product WHERE product.name ILIKE ?
pg:p
1.18x faster than drizzle:p
1.2x faster than pg
1.28x faster than drizzle
1.74x faster than typeorm
2.02x faster than mikro
2.07x faster than prisma
2.08x faster than knex
2.09x faster than kysely
• select all order with sum and count
------------------------------------------------- -----------------------------
pg 10.88 ms/iter (6.43 ms … 29.24 ms) 12.27 ms 29.24 ms 29.24 ms
pg:p 8.27 ms/iter (6.13 ms … 14.17 ms) 8.86 ms 14.17 ms 14.17 ms
drizzle 8.95 ms/iter (7.42 ms … 12.62 ms) 9.77 ms 12.62 ms 12.62 ms
drizzle:p 10.07 ms/iter (7.32 ms … 14.91 ms) 11.42 ms 14.91 ms 14.91 ms
knex 9.24 ms/iter (7.12 ms … 19.49 ms) 9.67 ms 19.49 ms 19.49 ms
kysely 9.38 ms/iter (6.58 ms … 23.09 ms) 10.28 ms 23.09 ms 23.09 ms
mikro 274.13 ms/iter (239.21 ms … 292.57 ms) 290.49 ms 292.57 ms 292.57 ms
typeorm 38.94 ms/iter (31.35 ms … 63.78 ms) 39.04 ms 63.78 ms 63.78 ms
prisma 75.38 ms/iter (64.5 ms … 94.8 ms) 79.84 ms 94.8 ms 94.8 ms
summary for select all order with sum and count
pg:p
1.08x faster than drizzle
1.12x faster than knex
1.13x faster than kysely
1.22x faster than drizzle:p
1.31x faster than pg
4.71x faster than typeorm
9.11x faster than prisma
33.13x faster than mikro
• select order with sum and count using limit with offset
------------------------------------------------- -----------------------------
pg 124.35 ms/iter (100.55 ms … 209.31 ms) 125.77 ms 209.31 ms 209.31 ms
pg:p 94.21 ms/iter (87.36 ms … 118.15 ms) 92.23 ms 118.15 ms 118.15 ms
drizzle 100.7 ms/iter (95.27 ms … 119.61 ms) 101.18 ms 119.61 ms 119.61 ms
drizle:p 91.89 ms/iter (82.76 ms … 150.41 ms) 86.71 ms 150.41 ms 150.41 ms
knex 99.79 ms/iter (92.62 ms … 112.78 ms) 105.24 ms 112.78 ms 112.78 ms
kysely 97.81 ms/iter (91.21 ms … 109.63 ms) 99.76 ms 109.63 ms 109.63 ms
mikro 177.4 ms/iter (170.34 ms … 188.28 ms) 180.38 ms 188.28 ms 188.28 ms
typeorm 158.91 ms/iter (148.38 ms … 192.19 ms) 160.47 ms 192.19 ms 192.19 ms
prisma 125.63 ms/iter (113.01 ms … 210.64 ms) 118.05 ms 210.64 ms 210.64 ms
summary for select order with sum and count using limit with offset
drizle:p
1.03x faster than pg:p
1.06x faster than kysely
1.09x faster than knex
1.1x faster than drizzle
1.35x faster than pg
1.37x faster than prisma
1.73x faster than typeorm
1.93x faster than mikro
• select order where order.id = ? with sum and count
------------------------------------------------- -----------------------------
pg 156.77 ms/iter (82.99 ms … 1.12 s) 96.39 ms 1.12 s 1.12 s
pg:p 85.93 ms/iter (70.47 ms … 165.75 ms) 86.69 ms 165.75 ms 165.75 ms
drizzle 118.6 ms/iter (100.03 ms … 146.16 ms) 127.3 ms 146.16 ms 146.16 ms
drizzle:p 117.49 ms/iter (91 ms … 152.79 ms) 135.43 ms 152.79 ms 152.79 ms
knex 152.52 ms/iter (94.64 ms … 241.5 ms) 168.67 ms 241.5 ms 241.5 ms
kysely 159.76 ms/iter (105.5 ms … 265.44 ms) 173.05 ms 265.44 ms 265.44 ms
mikro 320.03 ms/iter (216.58 ms … 436.04 ms) 348.77 ms 436.04 ms 436.04 ms
prisma 251.59 ms/iter (160.39 ms … 1.12 s) 190.84 ms 1.12 s 1.12 s
typeorm 360.08 ms/iter (217.89 ms … 1.25 s) 341.25 ms 1.25 s 1.25 s
summary for select order where order.id = ? with sum and count
pg:p
1.37x faster than drizzle:p
1.38x faster than drizzle
1.77x faster than knex
1.82x faster than pg
1.86x faster than kysely
2.93x faster than prisma
3.72x faster than mikro
4.19x faster than typeorm
• SELECT * FROM order_detail WHERE order_id = ?
------------------------------------------------- -----------------------------
pg 407.22 ms/iter (352.35 ms … 486.95 ms) 418.14 ms 486.95 ms 486.95 ms
pg:p 330.17 ms/iter (281.75 ms … 381.4 ms) 351.11 ms 381.4 ms 381.4 ms
drizzle 447.76 ms/iter (400.6 ms … 505.14 ms) 481.09 ms 505.14 ms 505.14 ms
drizzle:p 416.55 ms/iter (266.15 ms … 1.28 s) 365.39 ms 1.28 s 1.28 s
knex 456.09 ms/iter (397.44 ms … 535.1 ms) 508.03 ms 535.1 ms 535.1 ms
kysely 437.95 ms/iter (382.76 ms … 594.61 ms) 440.22 ms 594.61 ms 594.61 ms
mikro 885.97 ms/iter (841.21 ms … 957.26 ms) 917.52 ms 957.26 ms 957.26 ms
typeorm 482.95 ms/iter (454.86 ms … 527.15 ms) 495.79 ms 527.15 ms 527.15 ms
prisma 943.06 ms/iter (870.56 ms … 1.02 s) 992.96 ms 1.02 s 1.02 s
summary for SELECT * FROM order_detail WHERE order_id = ?
pg:p
1.23x faster than pg
1.26x faster than drizzle:p
1.33x faster than kysely
1.36x faster than drizzle
1.38x faster than knex
1.46x faster than typeorm
2.68x faster than mikro
2.86x faster than prisma
I would like to keep this issue open, as I suggest there should be at least a readme change for the minimum CPU requirements, and a way to use a remote url instead of docker. Its fine if someone from drizzle would like to close it.