Skip to content
This repository has been archived by the owner on Aug 11, 2021. It is now read-only.

perf: fixes #97 by not sorting DAGNode links when they are already sorted #98

Merged
merged 2 commits into from
Nov 6, 2018

Conversation

achingbrain
Copy link
Member

See #97 for context. Essentially when we are deserializing a DAGNode from a buffer, the links should already be sorted so just new up a DAGNode object and return it. Though we still have to calculate what the CID was that may have been used to load this DAGNode. See ipld/js-ipld#173 for further discussion on that point.

@ghost ghost assigned achingbrain Oct 30, 2018
@ghost ghost added the status/in-progress In progress label Oct 30, 2018
@achingbrain achingbrain requested review from vmx and daviddias October 30, 2018 17:41
Copy link
Member

@vmx vmx left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@achingbrain achingbrain force-pushed the do-not-sort-links-unnecessarily branch from f003847 to ccf8b5e Compare October 31, 2018 12:14
@codecov
Copy link

codecov bot commented Oct 31, 2018

Codecov Report

Merging #98 into master will decrease coverage by 0.52%.
The diff coverage is 71.42%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master      #98      +/-   ##
==========================================
- Coverage    90.8%   90.28%   -0.53%     
==========================================
  Files          13       13              
  Lines         272      278       +6     
==========================================
+ Hits          247      251       +4     
- Misses         25       27       +2
Impacted Files Coverage Δ
src/util.js 94.11% <71.42%> (-3.67%) ⬇️

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 fb365de...20f4cae. Read the comment docs.

@achingbrain
Copy link
Member Author

@vmx have updated the commit message

Copy link
Member

@vmx vmx left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'll merge it once CI passed.

@achingbrain achingbrain force-pushed the do-not-sort-links-unnecessarily branch from ccf8b5e to 20f4cae Compare October 31, 2018 13:26
Copy link
Member

@vmx vmx left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@achingbrain Can you please add a test for serialize() with an invalid node? I don't think we need to cover all error branches, but I haven't found a single test for invalid data.

@vmx vmx merged commit 3a8fb79 into master Nov 6, 2018
@ghost ghost removed the status/in-progress In progress label Nov 6, 2018
@achingbrain achingbrain deleted the do-not-sort-links-unnecessarily branch November 7, 2018 07:18
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants