From 5b81bdde396d13be90c959eea5fb4d3be81abec6 Mon Sep 17 00:00:00 2001 From: Sasasu Date: Tue, 28 Jul 2020 00:02:53 +0800 Subject: [PATCH] lib/storage: metaindexRow use memroy more efficiently (#655) due to memory align the metaindexRow structure use 64-byte pre object. this commit changes the order of field, make metaindexRow use 56-byte pre object. Signed-off-by: Sasasu --- lib/storage/metaindex_row.go | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/lib/storage/metaindex_row.go b/lib/storage/metaindex_row.go index 8dc1dbdbd..ef93d5deb 100644 --- a/lib/storage/metaindex_row.go +++ b/lib/storage/metaindex_row.go @@ -16,10 +16,6 @@ type metaindexRow struct { // TSID is the first TSID in the corresponding index block. TSID TSID - // BlockHeadersCount is the number of block headers - // in the given index block. - BlockHeadersCount uint32 - // MinTimestamp is the minimum timestamp in the given index block. MinTimestamp int64 @@ -29,6 +25,10 @@ type metaindexRow struct { // IndexBlockOffset is the offset of index block. IndexBlockOffset uint64 + // BlockHeadersCount is the number of block headers + // in the given index block. + BlockHeadersCount uint32 + // IndexBlockSize is the size of compressed index block. IndexBlockSize uint32 }