GithubHelp home page GithubHelp logo

drizzle-benchmarks's Introduction

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. You can use nvm use 18 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 ๐Ÿš€

drizzle-benchmarks's People

Contributors

alexblokh avatar angeloanan avatar

Stargazers

 avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.