Skip to content

Commit

Permalink
Periodic maintenance (#107)
Browse files Browse the repository at this point in the history
* Update dependencies and update tsdocs

* Update benchmark with new versions of libraries

* Linting fixes
  • Loading branch information
srknzl authored Sep 30, 2022
1 parent 377b52b commit 02869ce
Show file tree
Hide file tree
Showing 3 changed files with 106 additions and 106 deletions.
36 changes: 18 additions & 18 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -94,16 +94,16 @@ To run the benchmark run `npm install` and then `npm run benchmark`.
For now, benchmarked against [big.js](https://www.npmjs.com/package/big.js) and [bigdecimal](https://www.npmjs.com/package/bigdecimal).

* Test Machine:
* M1 2021 MacBook Pro
* 32 GB Ram
* MacOS Monterey 12.2.1
* Update Date: June 16th 2022
* M1 2021 MacBook Air
* 16 GB Ram
* MacOS Monterey 12.4
* Update Date: September 30th 2022
* Library versions used:
* big.js 6.1.1
* (this library) bigdecimal.js 1.1.3
* big.js 6.2.1
* (this library) bigdecimal.js 1.2.0
* bigdecimal 0.6.1
* bignumber.js: 9.0.2
* decimal.js:10.3.1
* bignumber.js: 9.1.0
* decimal.js:10.4.1

* Each operation is run with fixed set of decimal numbers composed of both simple and complex numbers.
* Micro benchmark framework used is [benchmark](https://www.npmjs.com/package/benchmark). Check out [benchmarks folder](https://github.com/srknzl/bigdecimal.js/tree/main/benchmarks) for source code of benchmarks.
Expand All @@ -112,16 +112,16 @@ For now, benchmarked against [big.js](https://www.npmjs.com/package/big.js) and

| Operation | Bigdecimal.js | Big.js | BigNumber.js | decimal.js | GWTBased |
| --- | --- | --- | --- | --- | --- |
| Constructor | 44,267 ( - ) | 38,737 (<span style="color:red">-12%</span>) | 42,046 (<span style="color:red">-5%</span>) | 42,947 (<span style="color:red">-3%</span>) | 2,819 (<span style="color:red">-94%</span>) |
| Add | 80,650 ( - ) | 18,308 (<span style="color:red">-77%</span>) | 101,400 (<span style="color:green">**+26%**</span>) | 61,821 (<span style="color:red">-23%</span>) | 90 (<span style="color:red">-100%</span>) |
| Subtract | 74,916 ( - ) | 17,771 (<span style="color:red">-76%</span>) | 96,674 (<span style="color:green">**+29%**</span>) | 58,300 (<span style="color:red">-22%</span>) | 92 (<span style="color:red">-100%</span>) |
| Multiply | 498,855 ( - ) | 33,907 (<span style="color:red">-93%</span>) | 27,577 (<span style="color:red">-94%</span>) | 84,791 (<span style="color:red">-83%</span>) | 2,735 (<span style="color:red">-99%</span>) |
| Divide | 15,874 ( - ) | 1,146 (<span style="color:red">-93%</span>) | 12,482 (<span style="color:red">-21%</span>) | 14,581 (<span style="color:red">-8%</span>) | 672 (<span style="color:red">-96%</span>) |
| Remainder | 10,174 ( - ) | 3,992 (<span style="color:red">-61%</span>) | 14,122 (<span style="color:green">**+39%**</span>) | 23,369 (<span style="color:green">**+130%**</span>) | 2,562 (<span style="color:red">-75%</span>) |
| Positive pow | 28,110 ( - ) | 25 (<span style="color:red">-100%</span>) | 128 (<span style="color:red">-100%</span>) | 3,847 (<span style="color:red">-86%</span>) | 6 (<span style="color:red">-100%</span>) |
| Negative pow | 5,178 ( - ) | 21 (<span style="color:red">-100%</span>) | 122 (<span style="color:red">-98%</span>) | 2,147 (<span style="color:red">-59%</span>) | 282 (<span style="color:red">-95%</span>) |
| Abs | 801,274 ( - ) | 1,520,066 (<span style="color:green">**+90%**</span>) | 957,966 (<span style="color:green">**+20%**</span>) | 391,313 (<span style="color:red">-51%</span>) | 14,215 (<span style="color:red">-98%</span>) |
| Compare | 557,156 ( - ) | 1,235,655 (<span style="color:green">**+122%**</span>) | 801,622 (<span style="color:green">**+44%**</span>) | 431,935 (<span style="color:red">-22%</span>) | 1,034,051 (<span style="color:green">**+86%**</span>) |
| Constructor | 44,023 ( - ) | 38,837 (<span style="color:red">-12%</span>) | 42,904 (<span style="color:red">-3%</span>) | 42,332 (<span style="color:red">-4%</span>) | 2,867 (<span style="color:red">-93%</span>) |
| Add | 80,680 ( - ) | 18,565 (<span style="color:red">-77%</span>) | 102,628 (<span style="color:green">**+27%**</span>) | 60,988 (<span style="color:red">-24%</span>) | 89 (<span style="color:red">-100%</span>) |
| Subtract | 74,621 ( - ) | 18,297 (<span style="color:red">-75%</span>) | 97,269 (<span style="color:green">**+30%**</span>) | 56,907 (<span style="color:red">-24%</span>) | 89 (<span style="color:red">-100%</span>) |
| Multiply | 503,718 ( - ) | 33,486 (<span style="color:red">-93%</span>) | 27,603 (<span style="color:red">-95%</span>) | 81,700 (<span style="color:red">-84%</span>) | 2,720 (<span style="color:red">-99%</span>) |
| Divide | 15,352 ( - ) | 1,129 (<span style="color:red">-93%</span>) | 12,169 (<span style="color:red">-21%</span>) | 14,022 (<span style="color:red">-9%</span>) | 679 (<span style="color:red">-96%</span>) |
| Remainder | 9,557 ( - ) | 3,916 (<span style="color:red">-59%</span>) | 14,052 (<span style="color:green">**+47%**</span>) | 22,538 (<span style="color:green">**+136%**</span>) | 2,605 (<span style="color:red">-73%</span>) |
| Positive pow | 27,710 ( - ) | 25 (<span style="color:red">-100%</span>) | 121 (<span style="color:red">-100%</span>) | 3,685 (<span style="color:red">-87%</span>) | 6 (<span style="color:red">-100%</span>) |
| Negative pow | 4,783 ( - ) | 21 (<span style="color:red">-100%</span>) | 117 (<span style="color:red">-98%</span>) | 2,063 (<span style="color:red">-57%</span>) | 277 (<span style="color:red">-94%</span>) |
| Abs | 771,310 ( - ) | 1,329,070 (<span style="color:green">**+72%**</span>) | 904,043 (<span style="color:green">**+17%**</span>) | 339,619 (<span style="color:red">-56%</span>) | 13,737 (<span style="color:red">-98%</span>) |
| Compare | 536,627 ( - ) | 1,180,043 (<span style="color:green">**+120%**</span>) | 764,960 (<span style="color:green">**+43%**</span>) | 393,814 (<span style="color:red">-27%</span>) | 1,010,649 (<span style="color:green">**+88%**</span>) |

[npm-image]: https://img.shields.io/npm/v/bigdecimal.js.svg
[npm-url]: https://npmjs.org/package/bigdecimal.js
Expand Down
34 changes: 17 additions & 17 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -59,22 +59,22 @@
},
"homepage": "https://srknzl.github.io/bigdecimal.js/",
"devDependencies": {
"@istanbuljs/nyc-config-typescript": "~1.0.2",
"@typescript-eslint/eslint-plugin": "~5.10.2",
"@typescript-eslint/parser": "~5.10.2",
"benchmark": "~2.1.4",
"big.js": "~6.1.1",
"bigdecimal": "~0.6.1",
"bignumber.js": "^9.0.2",
"chai": "~4.3",
"decimal.js": "^10.3.1",
"eslint": "~8.8.0",
"mocha": "~9.2.0",
"nyc": "~15.1.0",
"rimraf": "~3.0.2",
"source-map-support": "~0.5.21",
"ts-node": "~10.4.0",
"typedoc": "~0.22.11",
"typescript": "~4.5.5"
"@istanbuljs/nyc-config-typescript": "^1.0.2",
"@typescript-eslint/eslint-plugin": "^5.38.1",
"@typescript-eslint/parser": "^5.38.1",
"benchmark": "^2.1.4",
"big.js": "^6.2.1",
"bigdecimal": "^0.6.1",
"bignumber.js": "^9.1.0",
"chai": "^4.3",
"decimal.js": "^10.4.1",
"eslint": "^8.24.0",
"mocha": "^9.2.0",
"nyc": "^15.1.0",
"rimraf": "^3.0.2",
"source-map-support": "^0.5.21",
"ts-node": "^10.9.1",
"typedoc": "^0.23.15",
"typescript": "^4.8.4"
}
}
Loading

0 comments on commit 02869ce

Please # to comment.