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

Improve performance of Value's size #2625

Merged
merged 2 commits into from
Jan 21, 2022
Merged

Conversation

lehins
Copy link
Collaborator

@lehins lehins commented Jan 20, 2022

No description provided.

@redxaxder redxaxder self-requested a review January 20, 2022 23:28
| a `Set.member` s = loop s as
| otherwise =
let s' = Set.insert a s in s' `seq` a : loop s' as

Copy link
Contributor

@redxaxder redxaxder Jan 20, 2022

Choose a reason for hiding this comment

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

the ordered assumption could save on the set construction, since it suffices to compare an element to the previous one

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Sorry, I am not quite sure what you mean. Are trying to say that rawTriplets are already sorted on the snd element? If that's the case then we don't need this implementation of nubOrd.

Copy link
Contributor

Choose a reason for hiding this comment

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

There's a comment at the use site:

-- This assumes that the triples are ordered by nondecreasing asset name offset

It was based on my previous incorrect understanding of nub.

@lehins lehins merged commit 0566ad2 into master Jan 21, 2022
@iohk-bors iohk-bors bot deleted the lehins/improve-size-performannce branch January 21, 2022 01:19
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.

2 participants