Overtake
Performance benchmark for NodeJS

Table of Contents
Features
- CLI
- TypeScript support
- Running in thread worker
Installing
Using yarn:
$ yarn add -D overtake
Using npm:
$ npm install -D overtake
Examples
Public interface
Create a benchmark in __benchmarks__
folder
benchmark('mongodb vs postgres', () => {
setup(async () => {
const { Client } = await import('pg');
const postgres = new Client();
await postgres.connect();
const { MongoClient } = await import('mongob');
const mongo = new MongoClient(uri);
await mongo.connect();
return { postgres, mongo };
});
measure('mongodb inserts', ({ mongo } , next) => {
const database = mongo.db('overtake');
const test = database.collection('test');
return (data) => test.insertOne(data).then(next);
});
measure('postgres inserts', ({ postgres } , next) => {
const query = 'INSERT INTO overtake(value) VALUES($1) RETURNING *';
return (data) => postgres.query(query, [data.value]).then(next);
});
teardown(async ({ mongo, postgres }) => {
await postgres.end();
await mongo.end();
});
perform('simple test', 100000, [[{ value: 'test' }]]);
});
Make sure you have installed used modules and run
yarn overtake
or
npx overtake
Inline support
npx overtake -i "class A{}" -i "function A() {}" -i "A = () => {};" -c 20000
β Script
βΆ Suite
β€ Perform
β Measure class A{}
βββββββββββ¬βββββββββββ¬βββββββββββ¬βββββββββββ¬ββββββββββββ¬ββββββββ
β (index) β med β p95 β p99 β total β count β
βββββββββββΌβββββββββββΌβββββββββββΌβββββββββββΌββββββββββββΌββββββββ€
β 0.0005 β 0.000551 β 0.001493 β 0.002344 β 16.506385 β 20000 β
βββββββββββ΄βββββββββββ΄βββββββββββ΄βββββββββββ΄ββββββββββββ΄ββββββββ
β Measure function A() {}
βββββββββββ¬ββββββββββ¬βββββββββ¬βββββββββββ¬βββββββββββ¬ββββββββ
β (index) β med β p95 β p99 β total β count β
βββββββββββΌββββββββββΌβββββββββΌβββββββββββΌβββββββββββΌββββββββ€
β 0.00008 β 0.00009 β 0.0003 β 0.000441 β 2.875578 β 20000 β
βββββββββββ΄ββββββββββ΄βββββββββ΄βββββββββββ΄βββββββββββ΄ββββββββ
β Measure A = () => {};
βββββββββββ¬ββββββββββ¬βββββββββββ¬βββββββββββ¬ββββββββββ¬ββββββββ
β (index) β med β p95 β p99 β total β count β
βββββββββββΌββββββββββΌβββββββββββΌβββββββββββΌββββββββββΌββββββββ€
β 0.00008 β 0.00012 β 0.000331 β 0.000601 β 3.42556 β 20000 β
βββββββββββ΄ββββββββββ΄βββββββββββ΄βββββββββββ΄ββββββββββ΄ββββββββ
Please take a look at benchmarks to see more examples
Showcase
Already measured performance
License
License Apache-2.0
Copyright (c) 2021-present Ivan Zakharchanka