Skip to content

Commit

Permalink
perf: Replace lodash.isequal with fast-deep-equal
Browse files Browse the repository at this point in the history
  • Loading branch information
kantord committed May 23, 2018
1 parent f8db859 commit 1eb4edf
Show file tree
Hide file tree
Showing 4 changed files with 24 additions and 16 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,9 @@
"dependencies": {
"billboard.js": "^1.4.1",
"d3": "4.10.0",
"fast-deep-equal": "^2.0.1",
"fd-slicer": "^1.0.1",
"jq-web": "^0.1.3",
"lodash.isequal": "^4.5.0",
"sassline": "^2.1.2",
"spinkit": "^1.2.5",
"yamljs": "^0.3.0"
Expand Down
2 changes: 1 addition & 1 deletion src/state_handler.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import isEqual from 'lodash.isequal'
import isEqual from 'fast-deep-equal'

const create_state_handler = () => {
const state = {}
Expand Down
4 changes: 2 additions & 2 deletions src/state_handler.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ describe('state handler', () => {
const my_callback = sinon.spy()
const injector = require('inject-loader!./state_handler.js')
const state_handler = injector({
'lodash.isequal': () => true
'fast-deep-equal': () => true
}).default()
state_handler.subscribe(my_callback)
state_handler[method]('foo', 42)
Expand Down Expand Up @@ -141,7 +141,7 @@ describe('state handler', () => {
function() {state_handler.subscribe(my_callback)})
const injector = require('inject-loader!./state_handler.js')
const state_handler = injector({
'lodash.isequal': () => false
'fast-deep-equal': () => false
}).default()
state_handler.subscribe(my_callback)
state_handler.set_variable('foo', 42)
Expand Down
32 changes: 20 additions & 12 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -534,7 +534,7 @@ array-union@^1.0.1:
dependencies:
array-uniq "^1.0.1"

array-uniq@^1.0.1:
array-uniq@^1.0.0, array-uniq@^1.0.1:
version "1.0.3"
resolved "https://registry.yarnpkg.com/array-uniq/-/array-uniq-1.0.3.tgz#af6ac877a25cc7f74e058894753858dfdb24fdb6"

Expand Down Expand Up @@ -3779,6 +3779,13 @@ find-up@^2.0.0, find-up@^2.1.0:
dependencies:
locate-path "^2.0.0"

find-versions@^2.0.0:
version "2.0.0"
resolved "https://registry.yarnpkg.com/find-versions/-/find-versions-2.0.0.tgz#2ad90d490f6828c1aa40292cf709ac3318210c3c"
dependencies:
array-uniq "^1.0.0"
semver-regex "^1.0.0"

first-chunk-stream@^2.0.0:
version "2.0.0"
resolved "https://registry.yarnpkg.com/first-chunk-stream/-/first-chunk-stream-2.0.0.tgz#1bdecdb8e083c0664b91945581577a43a9f31d70"
Expand Down Expand Up @@ -5606,10 +5613,6 @@ lodash.get@^4.4.2:
version "4.4.2"
resolved "https://registry.yarnpkg.com/lodash.get/-/lodash.get-4.4.2.tgz#2d177f652fa31e939b4438d5341499dfa3825e99"

lodash.isequal@^4.5.0:
version "4.5.0"
resolved "https://registry.yarnpkg.com/lodash.isequal/-/lodash.isequal-4.5.0.tgz#415c4478f2bcc30120c22ce10ed3226f7d3e18e0"

lodash.isfunction@^3.0.8:
version "3.0.9"
resolved "https://registry.yarnpkg.com/lodash.isfunction/-/lodash.isfunction-3.0.9.tgz#06de25df4db327ac931981d1bdb067e5af68d051"
Expand Down Expand Up @@ -5752,9 +5755,9 @@ map-visit@^1.0.0:
dependencies:
object-visit "^1.0.0"

marked-terminal@^2.0.0:
version "2.0.0"
resolved "https://registry.yarnpkg.com/marked-terminal/-/marked-terminal-2.0.0.tgz#5eaf568be66f686541afa52a558280310a31de2d"
marked-terminal@^3.0.0:
version "3.0.0"
resolved "https://registry.yarnpkg.com/marked-terminal/-/marked-terminal-3.0.0.tgz#01758f657977a0e72ebd2a339f8ac100c1d04240"
dependencies:
cardinal "^1.0.0"
chalk "^1.1.3"
Expand Down Expand Up @@ -8032,9 +8035,9 @@ selfsigned@^1.9.1:
dependencies:
node-forge "0.7.5"

semantic-release@^15.4.1:
version "15.4.3"
resolved "https://registry.yarnpkg.com/semantic-release/-/semantic-release-15.4.3.tgz#08e8e8062b08aca02ea3d827ad8440a600c27548"
semantic-release@^15.5.0:
version "15.5.0"
resolved "https://registry.yarnpkg.com/semantic-release/-/semantic-release-15.5.0.tgz#cbbaefb311a41c6f41b2f1f4fbab91bd95db409b"
dependencies:
"@semantic-release/commit-analyzer" "^5.0.0"
"@semantic-release/error" "^2.2.0"
Expand All @@ -8047,21 +8050,26 @@ semantic-release@^15.4.1:
debug "^3.1.0"
env-ci "^2.0.0"
execa "^0.10.0"
find-versions "^2.0.0"
get-stream "^3.0.0"
git-log-parser "^1.2.0"
git-url-parse "^9.0.0"
hook-std "^0.4.0"
hosted-git-info "^2.6.0"
lodash "^4.17.4"
marked "^0.4.0"
marked-terminal "^2.0.0"
marked-terminal "^3.0.0"
p-locate "^2.0.0"
p-reduce "^1.0.0"
read-pkg-up "^3.0.0"
resolve-from "^4.0.0"
semver "^5.4.1"
yargs "^11.0.0"

semver-regex@^1.0.0:
version "1.0.0"
resolved "https://registry.yarnpkg.com/semver-regex/-/semver-regex-1.0.0.tgz#92a4969065f9c70c694753d55248fc68f8f652c9"

"semver@2 || 3 || 4 || 5", semver@^5.3.0, semver@^5.4.1, semver@^5.5.0:
version "5.5.0"
resolved "https://registry.yarnpkg.com/semver/-/semver-5.5.0.tgz#dc4bbc7a6ca9d916dee5d43516f0092b58f7b8ab"
Expand Down

0 comments on commit 1eb4edf

Please sign in to comment.