Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/netzwerg/immutable-js-perf
https://github.com/netzwerg/immutable-js-perf
Last synced: 5 days ago
JSON representation
- Host: GitHub
- URL: https://github.com/netzwerg/immutable-js-perf
- Owner: netzwerg
- Created: 2020-05-05T08:01:10.000Z (over 4 years ago)
- Default Branch: master
- Last Pushed: 2021-05-11T13:10:33.000Z (over 3 years ago)
- Last Synced: 2023-03-22T22:32:29.179Z (almost 2 years ago)
- Language: JavaScript
- Size: 12.7 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.adoc
Awesome Lists containing this project
README
= Potential Immutable.js Performance Regression
`src/benchmarks.js` measures performance of filtering an already sorted list of elements.
The list is 1 million items long, the predicate matches after the first 10 items (i.e. relatively early).Thus, the following expectations arise:
* `filter` will be slow because it always needs to traverse the complete list
* `skipUntil` and `findIndex` should be:
** faster than `filter`
** both be of similar performanceThese expectations hold true for 3.8.2 but *not* for 4.0.0-rc.12, *potentially indicating a regression*.
== Running Test
[source]
----
yarn install
yarn run start
----Compare `4.0.0-rc.12` and `3.8.2` (change version in `package.json`)
== Results
_macOS Mojave, 2.9 GHz Intel Core i9, node v12.9.1_
=== 4.0.0-rc.12
[source]
----
via filter:
6 ops/s, ±11.66% | 100% slowervia skipUntil:
5 ops/s, ±7.81% | slowest, 100% slowervia findIndex/takeLast:
680 918 ops/s, ±5.81% | fastest
----=== 3.8.2
[source]
----
via filter:
6 ops/s, ±1.89% | 14.29% slowervia skipUntil:
7 ops/s, ±2.49% | fastestvia findIndex/takeLast:
5 ops/s, ±6.30% | slowest, 28.57% slower
----