Commit Graph

12 Commits

Author SHA1 Message Date
YenForYang a8db640c62
Drop bradfitz/iter dependency (#605)
* Drop bradfitz/iter dependency

`range iter.N` looks nice and doesn't allocate, but unfortunately using a `range` expression blocks a function from being inlined wherever it's used (for now). It's not that we need inlining in all cases, but I do think a C-style for loop looks just as nice and is probably clearer to the majority. There also aren't any clear disadvantages to changing (unless you just happen to dislike the look of C)

* Update misc_test.go

* Update rlreader_test.go

* Update torrent_test.go

* Update bench_test.go

* Update client_test.go

* Update iplist_test.go

* Update mse_test.go

* Update peerconn_test.go

* Update peerconn.go

* Update order_test.go

* Update decoder_test.go

* Update main.go

* Update bench-piece-mark-complete.go

* Update main.go

* Update torrent.go

* Update iplist_test.go

* Update main.go
2021-09-14 13:46:50 +10:00
Matt Joiner e0a4831f27 Fix bitmap-related benchmark 2021-06-07 13:01:40 +10:00
Matt Joiner 95d72a452a Reduce allocations in iterBitmapsDistinct 2021-05-08 10:35:23 +10:00
Matt Joiner 456a2f7c5d Expose more callbacks and Request and ChunkSpec 2021-01-28 14:23:22 +11:00
Matt Joiner 4c989da21e Extract the request strategy logic
Bit messy. Now it'll be easier to clean-up what it depends on, and test.
2020-01-14 10:51:09 +11:00
Matt Joiner a1d2a32b20 Remove excess newline from log call 2018-06-13 10:56:09 +10:00
Matt Joiner 5cb73d6a37 Ensure ConnStats spew nicely 2018-06-12 22:40:04 +10:00
Matt Joiner 5023dcaa3a Fixes for non-pointer Bitmap corrupting state 2018-02-08 15:08:33 +11:00
Matt Joiner 6aad8041ab Implement new request strategy
The new strategy, 2, has the fastest connection download by priority in order, and all other pieces stick to a randomized ordering that's stable per connection.
2017-09-23 15:25:47 +10:00
Matt Joiner 64848a206a Replace go-check with testify
It's muuuuch better.
2015-08-03 16:23:05 +10:00
Matt Joiner c018c660f0 Allow chunk size to be specified per torrent 2015-07-15 15:31:18 +10:00
Matt Joiner ade6087b2f Move torrentOffsetRequest and torrentRequestOffset, fixing a bug in former, and test it 2015-04-08 02:20:01 +10:00