Skip to content

Latest commit

 

History

History
51 lines (42 loc) · 1.92 KB

README.md

File metadata and controls

51 lines (42 loc) · 1.92 KB

Drizzle Benchmarks

Drizzle has always been fast, we just wanted you to have a meaningful benchmarks experience

We ran our benchmarks on 2 separate machines, so that observer does not influence results. For database we're using PostgreSQL instance with 42MB of E-commerce data(~370k records).
K6 benchmarking instance lives on MacBook Air and makes 1M prepared requests through 1GB ethernet to Lenovo M720q with Intel Core i3-9100T and 32GB of RAM.

image

To run your own tests - follow instructions below!

Prepare test machine

  1. Spin up a docker container with PostgreSQL using pnpm start:docker command. You can configure a desired database port in ./src/docker.ts file:
...
}

const desiredPostgresPort = 5432; // change here
main();
  1. Update DATABASE_URL with allocated database port in .env file:
DATABASE_URL="postgres://postgres:postgres@localhost:5432/postgres"
  1. Seed your database with test data using pnpm start:seed command, you can change the size of the database in ./src/seed.ts file:
...
}

main("micro"); // nano | micro
  1. Make sure you have Node version 18 installed or above, we've used Node v22. You can use nvm use 22 command
  2. Start Drizzle/Prisma server:
## Drizzle
pnpm start:drizzle

## Prisma
pnpm prepare:prisma
pnpm start:prisma

Prepare testing machine

  1. Generate a list of http requests with pnpm start:generate. It will output a list of http requests to be run on the tested server | ./data/requests.json
  2. Install k6 load tester
  3. Configure tested server url in ./k6.js file
// const host = `http://192.168.31.144:3000`; // drizzle
const host = `http://192.168.31.144:3001`; // prisma
  1. Run tests with k6 run bench.js 🚀