Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/thangngoc89/maxperf
Javascript max perf FTW
https://github.com/thangngoc89/maxperf
Last synced: 6 days ago
JSON representation
Javascript max perf FTW
- Host: GitHub
- URL: https://github.com/thangngoc89/maxperf
- Owner: thangngoc89
- License: mit
- Created: 2017-07-05T17:24:26.000Z (over 7 years ago)
- Default Branch: master
- Last Pushed: 2017-07-05T17:48:17.000Z (over 7 years ago)
- Last Synced: 2025-01-10T07:07:26.704Z (16 days ago)
- Language: JavaScript
- Size: 20.5 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# maxperf
Javascript max perf FTWThis package is a collection of small utilities that can replace native code for max perf
# Map
Replace `Array.proptype.map`
I mostly use this in JSX mapping## Usage
```js
const map = require("maxperf/map")assert.deepEqual(
map([1, 2, 3, 4, 5], val => val * val),
[1, 2, 3, 4, 5].map(val => val * val)
)
```## Benchmark
```
❯ node map.bench
Array.prototype.map x 1,478,144 ops/sec ±2.17% (89 runs sampled)
maxperf/map x 11,525,104 ops/sec ±4.48% (68 runs sampled)
Fastest is maxperf/mapArray.prototype.map 100 000 elements x 493 ops/sec ±3.83% (70 runs sampled)
maxperf/map 100 000 elements x 302 ops/sec ±3.76% (65 runs sampled)
Fastest is Array.prototype.map 100 000 elements
```