From: Matt Joiner Date: Tue, 29 Sep 2020 06:37:58 +0000 (+1000) Subject: Optimize padding on Piece X-Git-Tag: v1.17.0~10 X-Git-Url: http://www.git.stargrave.org/?a=commitdiff_plain;h=808fd4b3825a26b026138ccad699aff9c4710fc9;p=btrtrc.git Optimize padding on Piece --- diff --git a/piece.go b/piece.go index fd0eb68a..2e6a4259 100644 --- a/piece.go +++ b/piece.go @@ -48,8 +48,8 @@ type Piece struct { // length can be determined by the request chunkSize in use. _dirtyChunks bitmap.Bitmap - hashing bool numVerifies int64 + hashing bool storageCompletionOk bool publicPieceState PieceState diff --git a/piece_test.go b/piece_test.go index 1843f95d..1e030b52 100644 --- a/piece_test.go +++ b/piece_test.go @@ -6,5 +6,7 @@ import ( ) func TestPieceSize(t *testing.T) { - t.Logf("%v", unsafe.Sizeof(Piece{})) + t.Log("[]*File", unsafe.Sizeof([]*File(nil))) + t.Log("Piece", unsafe.Sizeof(Piece{})) + t.Log("map[*peer]struct{}", unsafe.Sizeof(map[*peer]struct{}(nil))) }