Hello Adar Dembo,
I'd like you to do a code review. Please visit
http://gerrit.cloudera.org:8080/15439
to review the following change.
Change subject: client: micro-optimizations to reduce CPU and allocations
......................................................................
client: micro-optimizations to reduce CPU and allocations
Various small hot-spots I saw while profiling TSBS workloads which do a
high number of very short scans:
- replace vector<RemoteTabletServer> with boost's small_vector in spots
in the client where we expect to usually have a very small number of
qualifying servers.
- Optimize ResourceMetrics to use a dense_hash_map instead of a
std::map, which is more CPU efficient. Additionally, key the map based
on StringPieces instead of std::strings, since in our use case we are
always using strings with eternal lifetime (coming from the protobuf
Descriptor) here.
- Avoid creating a vector<FieldDescriptor*> when updating resource
metrics. Instead iterate over the fields using index-based APIs that
don't allocate.
- Add a move constructor for KuduSchema
- Use make_shared for ColumnSchema shared_ptrs to avoid some atomic ops
This cuts cycles used in tcmalloc in kudu-tsdbd for one workload by about
11%.
Change-Id: I705aef9f2e57d44f387b58650279130ff329666d
---
M src/kudu/client/client-internal.cc
M src/kudu/client/resource_metrics-internal.h
M src/kudu/client/resource_metrics.cc
M src/kudu/client/resource_metrics.h
M src/kudu/client/scanner-internal.cc
M src/kudu/client/schema.cc
M src/kudu/client/schema.h
M src/kudu/common/schema.h
8 files changed, 40 insertions(+), 11 deletions(-)
git pull ssh://gerrit.cloudera.org:29418/kudu refs/changes/39/15439/1
--
To view, visit http://gerrit.cloudera.org:8080/15439
To unsubscribe, visit http://gerrit.cloudera.org:8080/settings
Gerrit-Project: kudu
Gerrit-Branch: master
Gerrit-MessageType: newchange
Gerrit-Change-Id: I705aef9f2e57d44f387b58650279130ff329666d
Gerrit-Change-Number: 15439
Gerrit-PatchSet: 1
Gerrit-Owner: Todd Lipcon <[email protected]>
Gerrit-Reviewer: Adar Dembo <[email protected]>