Skip to content

Commit

Permalink
fixed readme.md <3
Browse files Browse the repository at this point in the history
  • Loading branch information
VietnamecDevelopment authored and yamiteru committed Mar 26, 2023
1 parent d6b40b4 commit 8e5bff7
Showing 1 changed file with 18 additions and 18 deletions.
36 changes: 18 additions & 18 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Isitfast
# Isitfast

A modular benchmarking library with V8 warmup and cpu/ram denoising for the most accurate and consistent results.

Expand All @@ -7,23 +7,23 @@ You no longer have to ask yourself `Is it fast?`. Just bench it!
## Features

- Waits until V8 optimizations kick in and benchmarks become less noisy
- Gets rid of performance noise caused by benchmark wrapper functions
- Gets rid of performance noise caused by benchmark wrapper functions
- Reuses a couple of `UInt32Array`s to store stats for less memory noise
- Runs GC before every benchmark and suite for less memory noise
- Uses high resolution time in nanoseconds for more accurate cpu results
- Exposes lifecycle events for listening to data in real-time
- Runs GC before every benchmark and suite for less memory noise
- Uses high resolution time in nanoseconds for more accurate cpu results
- Exposes lifecycle events for listening to data in real-time
- Prints colorful benchmark results into a terminal
- Allows combining different output strategies (terminal/markdown/etc.)

## Installation

```shell
yarn add benchpress
yarn add isitfast
```

## How to run

It's recommended to run `benchpress` with `--expose-gc` Node flag in order for the library to be able to run GC and collect more statistically correct memory data.
It's recommended to run `isitfast` with `--expose-gc` Node flag in order for the library to be able to run GC and collect more statistically correct memory data.

When used in TypeScript environment you can run it like this `node --expose-gc -r ts-node/register benchmarks/benchmarkName.ts`.

Expand All @@ -32,23 +32,23 @@ For the most accurate results it's recommended to run benchmark suites in differ
## Example

```ts
import { preset } from "benchpress";
import { preset } from "isitfast";

// define suite preset with options
// define suite preset with options
const defaultSuite = preset();

// define your suite with benchmarks
const testBenchmark = defaultSuite("Test", {
emptyAsync: async () => {},
emptySync: () => {},
emptyAsync: async () => {},
emptySync: () => {},
});

(async () => {
// collect data and print them into a terminal
useTerminal();
// collect data and print them into a terminal
useTerminal();

// run all benchmarks and trigger lifecycle events
await testBenchmark();
// run all benchmarks and trigger lifecycle events
await testBenchmark();
})();
```

Expand All @@ -60,7 +60,7 @@ Returns a `suite` preset with predefined options.

```ts
const suite = preset({
// options
// options
});
```

Expand Down Expand Up @@ -88,15 +88,15 @@ These are the default options:
}
```

### `suite`
### `suite`

Returns a function which asynchronously runs all provided benchmarks.

Usually you get this `suite` function from calling `preset` with options. But if you want just a suite with default options then you can import `suite` function directly from the library.

```ts
const runBenchmarks = suite("Name", {
// benchmarks
// benchmarks
});
```

Expand Down

0 comments on commit 8e5bff7

Please sign in to comment.