From aeaa59d4b55124b30c40c959de2f6eb90f7058e3 Mon Sep 17 00:00:00 2001 From: vyzo Date: Fri, 2 Jul 2021 11:41:12 +0300 Subject: [PATCH] move comments about tracking perf issues into a more pertinent place --- blockstore/splitstore/splitstore.go | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/blockstore/splitstore/splitstore.go b/blockstore/splitstore/splitstore.go index 912a808d6..5677c4770 100644 --- a/blockstore/splitstore/splitstore.go +++ b/blockstore/splitstore/splitstore.go @@ -232,8 +232,6 @@ func (s *SplitStore) Has(cid cid.Cid) (bool, error) { // treat it as an implicit Write, absence options -- the vm uses this check to avoid duplicate // writes on Flush. When we have options in the API, the vm can explicitly signal that this is // an implicit Write. - // Unfortunately we can't just directly tracker.Put one by one, as it is ridiculously slow with - // bolot because of syncing, so we batch them s.trackWrite(cid) // also make sure the object is considered live during compaction @@ -605,6 +603,8 @@ func (s *SplitStore) updateWriteEpoch() { } } +// Unfortunately we can't just directly tracker.Put one by one, as it is ridiculously slow with +// bbolt because of syncing (order of 10ms), so we batch them. func (s *SplitStore) trackWrite(c cid.Cid) { s.mx.Lock() defer s.mx.Unlock() @@ -612,6 +612,7 @@ func (s *SplitStore) trackWrite(c cid.Cid) { s.pendingWrites[c] = struct{}{} } +// and also combine batch writes into them func (s *SplitStore) trackWrites(cids []cid.Cid) { s.mx.Lock() defer s.mx.Unlock()