From 14cd6ed03322cfa0e7144d4542fd14b7504cc5be Mon Sep 17 00:00:00 2001 From: Zygo Blaxell Date: Tue, 12 Oct 2021 12:04:25 -0400 Subject: [PATCH] bees: deprecate vector and replace with ByteVector The vector in the hash table doesn't hurt very much--only a few microseconds per 128K hash block. The vector in BeesBlockData hurts a bit more--we run that constructor thousands of times per second. Signed-off-by: Zygo Blaxell --- src/bees-hash.cc | 2 +- src/bees.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/bees-hash.cc b/src/bees-hash.cc index d3373ee..cb0b2b5 100644 --- a/src/bees-hash.cc +++ b/src/bees-hash.cc @@ -123,7 +123,7 @@ BeesHashTable::flush_dirty_extent(uint64_t extent_index) THROW_CHECK2(out_of_range, dirty_extent_end, dirty_extent, dirty_extent_end - dirty_extent == BLOCK_SIZE_HASHTAB_EXTENT); BEESTOOLONG("pwrite(fd " << m_fd << " '" << name_fd(m_fd)<< "', length " << to_hex(dirty_extent_end - dirty_extent) << ", offset " << to_hex(dirty_extent - m_byte_ptr) << ")"); // Copy the extent because we might be stuck writing for a while - vector extent_copy(dirty_extent, dirty_extent_end); + ByteVector extent_copy(dirty_extent, dirty_extent_end); // Mark extent non-dirty while we still hold the lock m_extent_metadata.at(extent_index).m_dirty = false; diff --git a/src/bees.h b/src/bees.h index 494d736..40089ad 100644 --- a/src/bees.h +++ b/src/bees.h @@ -633,7 +633,7 @@ private: ostream & operator<<(ostream &os, const BeesHash &bh); class BeesBlockData { - using Blob = vector; + using Blob = ByteVector; mutable Fd m_fd; off_t m_offset;