]> git.apps.os.sepia.ceph.com Git - ceph.git/commit
os/bluestore: use std::unordered_map for SharedBlob lookup 11394/head
authorSage Weil <sage@redhat.com>
Mon, 10 Oct 2016 19:59:51 +0000 (15:59 -0400)
committerSage Weil <sage@redhat.com>
Tue, 11 Oct 2016 15:10:51 +0000 (11:10 -0400)
commit7260166da20bfe31469498e55265b40a12f80652
treefcc34c0f9aef19c904bbcad38a78a8b3453c8cad
parentb1853bfe9841d0943b3ed33838290bb2fabdbc4e
os/bluestore: use std::unordered_map for SharedBlob lookup

Many blobs aren't shared.  Save 8 bytes per SharedBlob by using a normal
unordered_map instead of instrusive::set.

More importantly, perhaps, it avoids us having to tune the intrusive
unordered_set size manually.  std::unordered_map does this automatically
for you, but the intrusive one does not.  And it's unclear how to
statically size it given that it's a per-collection structure and we have
no idea how many objects we'll have, how many blobs per object, and how
many objects will be cloned.

Signed-off-by: Sage Weil <sage@redhat.com>
src/os/bluestore/BlueStore.cc
src/os/bluestore/BlueStore.h
src/test/objectstore/test_bluestore_types.cc