Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/eeue56/mainc
A simple, small benchmarking library for Node
https://github.com/eeue56/mainc
Last synced: about 1 month ago
JSON representation
A simple, small benchmarking library for Node
- Host: GitHub
- URL: https://github.com/eeue56/mainc
- Owner: eeue56
- License: bsd-3-clause
- Created: 2021-07-08T14:23:52.000Z (over 3 years ago)
- Default Branch: main
- Last Pushed: 2021-12-25T18:46:19.000Z (about 3 years ago)
- Last Synced: 2024-11-05T21:27:22.596Z (2 months ago)
- Language: TypeScript
- Size: 204 KB
- Stars: 1
- Watchers: 4
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# mainc
A simple, small benchmarking library for Node
Looks in tsconfig.include for files ending with `bench`. Look in those files for functions starting with `bench`, and run them. Async functions are run with `await`. The return result is ignored.
Part of the [Hiraeth](https://github.com/eeue56/hiraeth) collection.
## Installation
Requires ts-node to be installed.
```
npm install --save-dev @eeue56/mainc
```## Usage
Make sure your tsconfig has `include` set up correctly. Then you can run bach via `npx @eeue56/mainc` from the project root.
See [mainc_bench.ts](src/mainc_bench.ts) for example usage.
You can also specify specific files or functions to run via flags:
```
--function [string...]: Run a specific function
--file [string...]: Run a specific file
-n number: Number of times to run each benchmark
--json : Output results as json
--compare : Run comparisons
--fixed number : Number of decimal places to go to. Defaults to 3
-h, --help : Displays help message```
## Name
Mainc means "bench" in Welsh. You'd pronounce it as "main-cuh"