Skip to content

Commit

Permalink
fix: readme table formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
Jacek Pietal committed Apr 12, 2024
1 parent 05318af commit 4bec099
Show file tree
Hide file tree
Showing 3 changed files with 35 additions and 33 deletions.
60 changes: 32 additions & 28 deletions README.md
Expand Up @@ -17,7 +17,7 @@ Detect-Collisions is a robust TypeScript library for detecting collisions among
## Installation

```bash
$ npm install detect-collisions
$ npm i detect-collisions --save
```

## API Documentation
Expand Down Expand Up @@ -186,32 +186,36 @@ $ cd detect-collisions
$ npm i && npm run build # will build & run tests & run benchmarks
```

```bash
??????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????
??? (index) ??? Task Name ??? Average Time (s) ??? Standard Deviation (s) ??? hz ??? p99 (s) ??? p995 (s) ???
??????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????
??? 0 ??? 'non overlapping circles' ??? 0.017 ??? 0.034 ??? 57315.994 ??? 0.044 ??? 0.187 ???
??? 1 ??? 'overlapping circles' ??? 0.017 ??? 0.028 ??? 57394.929 ??? 0.036 ??? 0.201 ???
??? 2 ??? 'non-overlapping triangles' ??? 0.059 ??? 0.034 ??? 16929.778 ??? 0.27 ??? 0.294 ???
??? 3 ??? 'overlapping triangles' ??? 0.064 ??? 0.033 ??? 15602.581 ??? 0.275 ??? 0.288 ???
??? 4 ??? 'non-overlapping quad' ??? 0.065 ??? 0.033 ??? 15404.47 ??? 0.274 ??? 0.285 ???
??? 5 ??? 'overlapping quad' ??? 0.064 ??? 0.032 ??? 15572.344 ??? 0.276 ??? 0.311 ???
??????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????
```

```bash
????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????
??? (index) ??? Task Name ??? ops/sec ??? Average Time (ns) ??? Margin ??? Samples ???
????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????
??? 0 ??? 'stress test, items=1000' ??? '317' ??? 3148675.97799631 ??? '??1.58%' ??? 318 ???
??? 1 ??? 'stress test, items=2000' ??? '157' ??? 6330735.7974397605 ??? '??1.52%' ??? 158 ???
??? 2 ??? 'stress test, items=3000' ??? '75' ??? 13327073.447455307 ??? '??0.99%' ??? 76 ???
??? 3 ??? 'stress test, items=4000' ??? '57' ??? 17520130.72403597 ??? '??2.13%' ??? 58 ???
??? 4 ??? 'stress test, items=5000' ??? '40' ??? 24748692.02477176 ??? '??3.33%' ??? 41 ???
??? 5 ??? 'stress test, items=6000' ??? '30' ??? 32862712.38771658 ??? '??2.96%' ??? 31 ???
??? 6 ??? 'stress test, items=7000' ??? '19' ??? 51916039.55030441 ??? '??2.22%' ??? 20 ???
??? 7 ??? 'stress test, items=8000' ??? '18' ??? 55266960.577941254 ??? '??2.34%' ??? 19 ???
??? 8 ??? 'stress test, items=9000' ??? '14' ??? 66757363.86602123 ??? '??1.59%' ??? 15 ???
??? 9 ??? 'stress test, items=10000' ??? '12' ??? 77764442.38424301 ??? '??3.07%' ??? 13 ???
????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????
> detect-collisions@9.5.5 benchmark-insertion
> node -e 'require(`./dist/benchmarks`).insertionBenchmark()'
┌─────────┬─────────────────────────────┬──────────────────┬────────────────────────┬───────────┬─────────┬──────────┐
│ (index) │ Task Name │ Average Time (s) │ Standard Deviation (s) │ hz │ p99 (s) │ p995 (s) │
├─────────┼─────────────────────────────┼──────────────────┼────────────────────────┼───────────┼─────────┼──────────┤
│ 0 │ 'non overlapping circles' │ 0.017 │ 0.024 │ 59546.672 │ 0.036 │ 0.179 │
│ 1 │ 'overlapping circles' │ 0.017 │ 0.019 │ 57398.492 │ 0.031 │ 0.194 │
│ 2 │ 'non-overlapping triangles' │ 0.057 │ 0.033 │ 17646.738 │ 0.263 │ 0.271 │
│ 3 │ 'overlapping triangles' │ 0.06 │ 0.031 │ 16580.923 │ 0.266 │ 0.275 │
│ 4 │ 'non-overlapping quad' │ 0.063 │ 0.032 │ 15993.04 │ 0.268 │ 0.287 │
│ 5 │ 'overlapping quad' │ 0.062 │ 0.031 │ 16138.151 │ 0.267 │ 0.277 │
└─────────┴─────────────────────────────┴──────────────────┴────────────────────────┴───────────┴─────────┴──────────┘
> detect-collisions@9.5.5 benchmark-stress
> node -r pixi-shim -e 'require(`./dist/benchmarks`).stressBenchmark()'
┌─────────┬────────────────────────────┬─────────┬────────────────────┬───────────┬─────────┐
│ (index) │ Task Name │ ops/sec │ Average Time (ns) │ Margin │ Samples │
├─────────┼────────────────────────────┼─────────┼────────────────────┼───────────┼─────────┤
│ 0 │ 'stress test, items=1000' │ '328' │ 3040152.9968011347 │ '±1.53%' │ 329 │
│ 1 │ 'stress test, items=2000' │ '142' │ 7036809.1396310115 │ '±1.24%' │ 143 │
│ 2 │ 'stress test, items=3000' │ '89' │ 11138342.555860678 │ '±1.40%' │ 90 │
│ 3 │ 'stress test, items=4000' │ '51' │ 19251488.80753953 │ '±1.92%' │ 52 │
│ 4 │ 'stress test, items=5000' │ '42' │ 23662193.696686003 │ '±2.82%' │ 43 │
│ 5 │ 'stress test, items=6000' │ '29' │ 34045372.166484594 │ '±3.89%' │ 30 │
│ 6 │ 'stress test, items=7000' │ '22' │ 43783659.75090613 │ '±4.48%' │ 24 │
│ 7 │ 'stress test, items=8000' │ '14' │ 69103674.99937613 │ '±1.96%' │ 15 │
│ 8 │ 'stress test, items=9000' │ '11' │ 89361312.33225267 │ '±43.04%' │ 12 │
│ 9 │ 'stress test, items=10000' │ '12' │ 78276474.53947708 │ '±2.32%' │ 13 │
└─────────┴────────────────────────────┴─────────┴────────────────────┴───────────┴─────────┘
```

0 comments on commit 4bec099

Please sign in to comment.