Giter Club home page Giter Club logo

fast-deep-equal's Introduction

fast-deep-equal

The fastest deep equal

Build Status npm npm Coverage Status

This readme is for pre-release v3 with ES6 Map, Set and Typed arrays support.

See branch v2 for the main version.

Install

To install v3 pre-release with ES6 Map, Set and Typed arrays support

npm install fast-deep-equal@beta

To install v2

npm install fast-deep-equal

Features

  • ES5 compatible
  • works in node.js (8+) and browsers (IE9+)
  • checks equality of Date and RegExp objects by value.

ES6 equal (require('fast-deep-equal/es6')) also supports:

  • Maps
  • Sets
  • Typed arrays

Usage

var equal = require('fast-deep-equal');
console.log(equal({foo: 'bar'}, {foo: 'bar'})); // true

To support ES6 Maps, Sets and Typed arrays equality use:

var equal = require('fast-deep-equal/es6');
console.log(equal(Int16Array([1, 2]), Int16Array([1, 2]))); // true

Performance benchmark

Node.js v12.6.0:

fast-deep-equal x 325,485 ops/sec ±0.57% (86 runs sampled)
fast-deep-equal/es6 x 261,338 ops/sec ±0.45% (89 runs sampled)
nano-equal x 231,064 ops/sec ±0.62% (88 runs sampled)
shallow-equal-fuzzy x 164,828 ops/sec ±0.87% (88 runs sampled)
underscore.isEqual x 91,247 ops/sec ±0.56% (88 runs sampled)
lodash.isEqual x 48,000 ops/sec ±0.48% (86 runs sampled)
deep-equal x 73,699 ops/sec ±0.55% (86 runs sampled)
deep-eql x 42,804 ops/sec ±0.45% (87 runs sampled)
ramda.equals x 15,119 ops/sec ±0.49% (87 runs sampled)
util.isDeepStrictEqual x 58,458 ops/sec ±0.56% (89 runs sampled)
assert.deepStrictEqual x 583 ops/sec ±0.47% (87 runs sampled)

The fastest is fast-deep-equal

To run benchmark (requires node.js 6+):

npm run benchmark

License

MIT

fast-deep-equal's People

Contributors

chrisbolin avatar danalloway avatar epoberezkin avatar futurfrukt avatar kaievns avatar krzysiek1507 avatar langpavel avatar streamich avatar xobotyi avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.