🚀 Big News: Socket Acquires Coana to Bring Reachability Analysis to Every Appsec Team.Learn more
Socket
Book a DemoInstallSign in
Socket

fast-bind

Package Overview
Dependencies
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

fast-bind

the fastest version of Function#bind I could make

1.0.0
latest
Source
npm
Version published
Weekly downloads
84K
13.54%
Maintainers
1
Weekly downloads
 
Created
Source

Build Status

fast-bind

The fastest Function#bind I could find.

Function#bind (native) x 709,955 ops/sec ±1.79% (84 runs sampled)
Function#bind (slice) x 2,610,293 ops/sec ±1.43% (99 runs sampled)
Function#bind (concat) x 2,622,574 ops/sec ±0.79% (101 runs sampled)
Function#bind (loop) x 2,952,311 ops/sec ±1.63% (95 runs sampled)
Fastest is Function#bind (loop)
4.16x as fast as Function#bind (native)

Installation

npm install fast-bind

API

Function.prototype.bind = require('fast-bind')

Faster

The previous version did not handle using the bound function as a constructor. This requires an instanceof check, and slows everything down a bunch.

Function#bind (native) x 803,410 ops/sec ±2.35% (79 runs sampled)
Function#bind (slice) x 4,771,960 ops/sec ±0.95% (99 runs sampled)
Function#bind (concat) x 3,838,614 ops/sec ±1.41% (95 runs sampled)
Function#bind (loop) x 6,440,278 ops/sec ±0.69% (97 runs sampled)
Fastest is Function#bind (loop)
8.02x as fast as Function#bind (native)

Keywords

function

FAQs

Package last updated on 03 Nov 2014

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts