-
Notifications
You must be signed in to change notification settings - Fork 112
Conversation
|
b6787e8
to
106b96f
Compare
b35b77b
to
ea653e3
Compare
Some pretty exciting results with ls-ing Wikipedia Master
Master
This PR
This PR
|
Table updated:
|
Table updated w/ cde89cb
Remaining:
That said this is approaching the point where if nothing else, it does no further harm and seems to be an improvement in most cases. Need a bit more work, but closing in. |
0666ee8
to
16f00de
Compare
d955a72
to
1fcf6a7
Compare
1fcf6a7
to
989fa78
Compare
989fa78
to
2bf9971
Compare
2bf9971
to
4bfa7b7
Compare
I've removed the WIP label on this cause I think it can be merged in its current state and is ready for review. |
4bfa7b7
to
19d2f35
Compare
spm.tagPeer(p) | ||
} else { | ||
if isOptimized { | ||
if spm.optimizedPeersArr[0] == p { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
put this in function
} | ||
} | ||
|
||
func (s *Session) updateReceiveCounters(ctx context.Context, blk blkRecv) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Move RecordUniqueBlock to receiveBlock
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hannah and I walked through this PR together and it's complicated, in large part because it's building additional smarts on top of the existing (somewhat complicated) sessions implementation. There's a good chance that simpler splitting implementations will be effective. But this implementation offers some solid benefits in some real world testing.
Order optimized peers by most recent to receive a block
Reduce duplicates through splits of requests
As soon as peers appear, consume all of the want budget
Move the job of splitting requests to its own package
19d2f35
to
a0fd23c
Compare
FYI: Something is wrong with Jenkins for this branch -- I cannot get anything to build any more. If I checkout a seperate branch based on the latest commit from this branch, and push it, it builds and passes. I dunno what's wrong, but I am just going to continue this review until people LGTM it, and then create a seperate PR at the end to verify build and merge. Ug. |
@Stebalien + @magik6k would love a review from either of you before this gets merged. If it's complicated to read, I can pair with you. If it feels two complicated, and needs to be simpler in order to merge, that's feedback I can work off and improve. I'm going to do that anyway but am about to go away for two weeks so I'm trying to get something merged before I leave :) |
& @magik6k if you have any insight into what's up with Jenkins I'd super duper appreciate it! |
Rebase should help |
a2c6bad
to
02cabda
Compare
Encapsulate functions for readability, and move code for understanding
02cabda
to
b1a82dc
Compare
merging, per @eingenito |
Stated changes sound good to me! I havent read the code in detail, but it looks fairly clean and well tested. I'd still like one of us to get a review in on it at some point, but i'm happy to get things pushed through if youre confident in them. Also, you can refer to me as @whyrusleeping ;) I try to keep human names off github |
Speed up sessions Round ipfs#1 This commit was moved from ipfs/go-bitswap@43c65d4
Goals
This is an initial PR to speed up sessions and reduce dupes. It is not the ONLY improvement I'm working on, but it makes significant progress. It matches Jeremy's PR on benchmarks for dupes (for the most part), but matches master on speed (for the most part). In addition, it shows impressive results with
LS
on Wikipedia. See results in comments.Implementation
This PR has basically 3 improvements:
The session peer manager is just SLIGHTLY smarter in that:
a. It returns a maximum of 32 peers (why would you ever need to ask more at once?)
b. It somewhat prioritizes the best peers. The strategy is simply if you receive a block from a peer first, you assume that's a good peer and put it at the front of the list for peers on your next want request. This is not ordering peers by latency, it's just assuming whoever responds is a good person to ask next.
The split broadcast vs target max want list for sessions from jeremy's code is copied over. Basically, this is just the assumption that you broadcast only 4 wants at once (previously 16), but once you have peers, you go up to 32 on targeted requests
Requests for a series of blocks are split among peers, similarly to Jeremy's PR. However, where Jeremy's PR kept the splitting right in the Session, this moves the splitting out to a separate SessionRequestSplitter module. The strategy pursued is slightly different, and is simply attempting to minimize dupes w/o slowing down the overall request speed by:
a. If dupes go above a certain threshold, increase the split factor
b. If they fall below a certain threshold, decrease the split factor (to increase speed, just in case)
Honestly, there are a lot of better ways to do this, but this is functional and works well. (though it vacillates between extremes, cause there's minimal throttling of these adjustments)
c. To make this work, dupes are now tracked on a per session basis (and we keep a list of past wants to know what's a dupe)
Next
Once this PR is merged, there are three further optimizations:
For discussion
This is not a "end goal" PR for session speedup, but a first step and a framework for further optimizations (basically, improvements to the peer manager and the request splitter can proceed independently). I actually have progress on some of the above next steps, but I feel like that should be in a separate PR, so the number of changes aren't overwhelming, and also, I want to make sure this approach feels ok to people.
This also includes some minor changes to the benchmarks, primarily to put the saved json file in a folder that isn't included in git commits.