Todd Lipcon has posted comments on this change. ( http://gerrit.cloudera.org:8080/15800 )
Change subject: KUDU-2844 (1/3): make BlockHandle ref-counted ...................................................................... Patch Set 2: (1 comment) http://gerrit.cloudera.org:8080/#/c/15800/2/src/kudu/cfile/block_handle.h File src/kudu/cfile/block_handle.h: http://gerrit.cloudera.org:8080/#/c/15800/2/src/kudu/cfile/block_handle.h@94 PS2, Line 94: boost::variant<BlockCacheHandle, std::shared_ptr<BlockHandle>> ref_; > Since we use std::make_shared I think it ends up with the same single-alloc One further note here: it would be easy to cut out the enable_shared_from_this inheritance by making SubrangeBlock be a static function that takes a shared_ptr argument, instead of using shared_from_this() there. Then we only have 16 bytes per object overhead instead of 32. That said, the shared_ptr<BlockHandle> itself is 16 bytes vs 8 for scoped_refptr. So, overall, scoped_refptr is more memory efficient. I think I'm inclined to go back to scoped_refptr since I can't find any advantage to shared_ptr except that it's standard. -- To view, visit http://gerrit.cloudera.org:8080/15800 To unsubscribe, visit http://gerrit.cloudera.org:8080/settings Gerrit-Project: kudu Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: I1077fcc841ca31a2cb523769fffeed2d27782bc1 Gerrit-Change-Number: 15800 Gerrit-PatchSet: 2 Gerrit-Owner: Todd Lipcon <t...@apache.org> Gerrit-Reviewer: Alexey Serbin <aser...@cloudera.com> Gerrit-Reviewer: Andrew Wong <andrew.w...@cloudera.com> Gerrit-Reviewer: Andrew Wong <aw...@cloudera.com> Gerrit-Reviewer: Kudu Jenkins (120) Gerrit-Reviewer: Todd Lipcon <t...@apache.org> Gerrit-Reviewer: Volodymyr Verovkin <verjov...@cloudera.com> Gerrit-Comment-Date: Thu, 13 Aug 2020 20:32:14 +0000 Gerrit-HasComments: Yes