mirror of
https://github.com/Zygo/bees.git
synced 2025-05-17 21:35:45 +02:00
bees: deprecate vector<uint8_t> and replace with ByteVector
The vector<uint8_t> in the hash table doesn't hurt very much--only a few microseconds per 128K hash block. The vector<uint8_t> in BeesBlockData hurts a bit more--we run that constructor thousands of times per second. Signed-off-by: Zygo Blaxell <bees@furryterror.org>
This commit is contained in:
parent
99709d889f
commit
14cd6ed033
@ -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);
|
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) << ")");
|
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
|
// Copy the extent because we might be stuck writing for a while
|
||||||
vector<uint8_t> 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
|
// Mark extent non-dirty while we still hold the lock
|
||||||
m_extent_metadata.at(extent_index).m_dirty = false;
|
m_extent_metadata.at(extent_index).m_dirty = false;
|
||||||
|
@ -633,7 +633,7 @@ private:
|
|||||||
ostream & operator<<(ostream &os, const BeesHash &bh);
|
ostream & operator<<(ostream &os, const BeesHash &bh);
|
||||||
|
|
||||||
class BeesBlockData {
|
class BeesBlockData {
|
||||||
using Blob = vector<uint8_t>;
|
using Blob = ByteVector;
|
||||||
|
|
||||||
mutable Fd m_fd;
|
mutable Fd m_fd;
|
||||||
off_t m_offset;
|
off_t m_offset;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user