Todd Lipcon has submitted this change and it was merged. ( http://gerrit.cloudera.org:8080/15064 )
Change subject: schema: use dense_hash_map instead of std::unordered_map ...................................................................... schema: use dense_hash_map instead of std::unordered_map In a time series benchmark I'm working on, the client spent 12% of its CPU in Schema::FindColumn. In particular, most of the CPU went to the bucket calculation in std::unordered_map, which required a 'divq' instruction that can take hundreds of cycles. This switches Schema to use a dense_hash_map instead which performs better. After this change, the percent of CPU used by my benchmark worker thread in Schema::FindColumn dropped from ~12% to ~1.5% which resulted in a few percent overall throughput increase. This also made the fancy allocator which tried to count memory usage unnecessary, since dense_hash_map is a simple enough data structure that we can directly compute the memory usage. Now we can also simplify the constructors since we no longer need to pass an allocator instance. Change-Id: I8e8f80229b2dcfad05e204a6f6e50ce7dc3f4c73 Reviewed-on: http://gerrit.cloudera.org:8080/15064 Reviewed-by: Adar Dembo <[email protected]> Tested-by: Kudu Jenkins --- M src/kudu/client/client-test.cc M src/kudu/common/schema.cc M src/kudu/common/schema.h M src/kudu/common/wire_protocol.cc M thirdparty/download-thirdparty.sh A thirdparty/patches/sparsehash-0002-Add-workaround-for-dense_hashtable-move-constructor-.patch 6 files changed, 88 insertions(+), 86 deletions(-) Approvals: Adar Dembo: Looks good to me, approved Kudu Jenkins: Verified -- To view, visit http://gerrit.cloudera.org:8080/15064 To unsubscribe, visit http://gerrit.cloudera.org:8080/settings Gerrit-Project: kudu Gerrit-Branch: master Gerrit-MessageType: merged Gerrit-Change-Id: I8e8f80229b2dcfad05e204a6f6e50ce7dc3f4c73 Gerrit-Change-Number: 15064 Gerrit-PatchSet: 6 Gerrit-Owner: Todd Lipcon <[email protected]> Gerrit-Reviewer: Adar Dembo <[email protected]> Gerrit-Reviewer: Alexey Serbin <[email protected]> Gerrit-Reviewer: Kudu Jenkins (120) Gerrit-Reviewer: Todd Lipcon <[email protected]>
