Skip to content

Replace vecAskFor with a priority queue#3147

Merged
UdjinM6 merged 1 commit intodashpay:developfrom
codablock:pr_vecaskfor
Oct 16, 2019
Merged

Replace vecAskFor with a priority queue#3147
UdjinM6 merged 1 commit intodashpay:developfrom
codablock:pr_vecaskfor

Conversation

@codablock
Copy link

This avoids sorting before looping through it to figure out what to
request. The assumption that sorting would be cheap when vecAskFor is
already mostly sorted (only unsorted at the end) turned out to be false.
In reality, ~50% of CPU time was consumed by the sort when a lot of traffic
(thousands of TXs) happen.

This avoids sorting before looping through it to figure out what to
request. The assumption that sorting would be cheap when vecAskFor is
already mostly sorted (only unsorted at the end) turned out to be false.
In reality, ~50% of CPU time was consumed by the sort when a lot of traffic
(thousands of TXs) happen.
@codablock codablock added this to the 14.1 milestone Oct 11, 2019
Copy link

@UdjinM6 UdjinM6 left a comment

Choose a reason for hiding this comment

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

utACK

nit: time to rename MAPASKFOR_MAX_SZ? :)

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