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

perf: findLatestTransaction #832

Merged
merged 4 commits into from Dec 30, 2018

Conversation

@kalgoop
Copy link
Contributor

commented Dec 21, 2018

Proposed changes

instead of sorting and then picking the latest transaction, loop over all transactions to find the latest transaction.
Reduces complexity from O(nlogn) to O(n)

Types of changes

  • Refactoring (improve a current implementation without adding a new feature or fixing a bug)

Checklist

  • I have read the CONTRIBUTING documentation
  • Lint and unit tests pass locally with my changes

kalgoop added some commits Dec 21, 2018

@dated dated referenced this pull request Dec 28, 2018
3 of 3 tasks complete
@kalgoop

This comment has been minimized.

Copy link
Contributor Author

commented Dec 29, 2018

@faustbrian

This comment has been minimized.

Copy link
Contributor

commented Dec 30, 2018

@faustbrian faustbrian closed this Dec 30, 2018

@kalgoop

This comment has been minimized.

Copy link
Contributor Author

commented Dec 30, 2018

@faustbrian this PR introduces changes different than those in #878 .
The former code and code after #878 both have complexity O(nlogn) for finding latest transaction. This PR achieved that in O(n)

@dated

This comment has been minimized.

Copy link
Contributor

commented Dec 30, 2018

He's actually right 🤔

@faustbrian faustbrian reopened this Dec 30, 2018

@faustbrian faustbrian merged commit 40c7193 into ArkEcosystem:develop Dec 30, 2018

1 check passed

ci/circleci: test-node-9 Your tests passed on CircleCI!
Details

@kalgoop kalgoop deleted the kalgoop:patch-8 branch Dec 30, 2018

PHANTOM-DEV1 added a commit to PhantomChain/desktop-wallet that referenced this pull request Jan 9, 2019

PHANTOM-DEV1 added a commit to PhantomChain/desktop-wallet that referenced this pull request Jan 17, 2019

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
4 participants
You can’t perform that action at this time.