]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commit
os/KeyValueDB: reduce malloc/free/string copy count
authorPiotr Dałek <piotr.dalek@ts.fujitsu.com>
Thu, 15 Oct 2015 13:40:06 +0000 (15:40 +0200)
committerSage Weil <sage@redhat.com>
Mon, 19 Oct 2015 16:57:23 +0000 (12:57 -0400)
commit709b111ceafe3893e82e3d576aa7b2d58bd16516
tree78e2c72542b4d9e83f3da61ed08b720d13597901
parente1783d23332258b34f89aae35c853be481656f24
os/KeyValueDB: reduce malloc/free/string copy count

In RocksDB, LevelDB and Kinetic wrapper code, there is unnecessary
string copying. In particular, split_key makes an extra copy of string
(as a basis for extracted key and/or value), which can be easily omitted.
Also, checking for iterator validity generates std::pair with prefix
and key and checks prefix with the one from pair, wasting memory for
key.

Signed-off-by: Piotr Dałek <piotr.dalek@ts.fujitsu.com>
src/kv/KeyValueDB.h
src/kv/KineticStore.cc
src/kv/KineticStore.h
src/kv/LevelDBStore.cc
src/kv/LevelDBStore.h
src/kv/RocksDBStore.cc
src/kv/RocksDBStore.h