Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove spread operator in object diffs to increase performance #64

Merged
merged 1 commit into from
Jan 25, 2022

Conversation

SheneekaW
Copy link
Contributor

Motivation and Context

While using detailedDiff from this library, ran into an issue where large enough files would cause functions to just hang. After updating the object value assignments and removing the spread operator (...), the performance improved.

**Note did not remove the spread operator from the array function or smaller utility functions.

image

Relied on the following functions for timing and heap usage:

console.time()
console.timeEnd()
process.memoryUsage()

How Has This Been Tested?

While making changes, made sure test suite was still good with npm test runs

@coveralls
Copy link

coveralls commented Jun 2, 2021

Coverage Status

Coverage remained the same at 100.0% when pulling 3c6c607 on SheneekaW:remove-spread-op into 6296889 on mattphillips:master.

@anko
Copy link
Contributor

anko commented Jun 5, 2021

Possibly equivalent to #47? It was closed for some reason.

@codecov-commenter
Copy link

codecov-commenter commented Jan 25, 2022

Codecov Report

Merging #64 (70aa278) into main (8c09976) will not change coverage.
The diff coverage is 100.00%.

❗ Current head 70aa278 differs from pull request most recent head 1d430f4. Consider uploading reports for the commit 1d430f4 to get more accurate results
Impacted file tree graph

@@            Coverage Diff            @@
##              main       #64   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files            7         7           
  Lines           99       109   +10     
  Branches        36        36           
=========================================
+ Hits            99       109   +10     
Impacted Files Coverage Δ
src/added.js 100.00% <100.00%> (ø)
src/deleted.js 100.00% <100.00%> (ø)
src/diff.js 100.00% <100.00%> (ø)
src/updated.js 100.00% <100.00%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 8c09976...1d430f4. Read the comment docs.

@mattphillips mattphillips merged commit 4c855be into mattphillips:main Jan 25, 2022
@mattphillips
Copy link
Owner

Thanks @SheneekaW will get this published ASAP

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants