Hello Mike Percy,

I'd like you to do a code review. Please visit

    http://gerrit.cloudera.org:8080/9894

to review the following change.


Change subject: perf: avoid unnecessary floating point division and 
multiplication
......................................................................

perf: avoid unnecessary floating point division and multiplication

I noticed looking at a profile that Trace::SubstituteAndTrace was
spending a fair number of cycles in some floating point math, and
tracked it down to our use of constants like '1e3' and '1e6'. These are
floating point constants even though we would do just as well with
integer multiplication and division for this use case.

I verified that switching to the integer versions of the constants
changed the generated assembly to avoid costly division instructions[1].

This patch fixes that case as well as a few others with the same
pattern.

[1] https://godbolt.org/g/dmE7Av

Change-Id: I3985433056aab163cc65972e94bc2108f00546a3
---
M src/kudu/clock/hybrid_clock.cc
M src/kudu/gutil/walltime.h
M src/kudu/rpc/reactor.cc
M src/kudu/util/env_posix.cc
M src/kudu/util/logging.h
5 files changed, 9 insertions(+), 9 deletions(-)



  git pull ssh://gerrit.cloudera.org:29418/kudu refs/changes/94/9894/1
--
To view, visit http://gerrit.cloudera.org:8080/9894
To unsubscribe, visit http://gerrit.cloudera.org:8080/settings

Gerrit-Project: kudu
Gerrit-Branch: master
Gerrit-MessageType: newchange
Gerrit-Change-Id: I3985433056aab163cc65972e94bc2108f00546a3
Gerrit-Change-Number: 9894
Gerrit-PatchSet: 1
Gerrit-Owner: Todd Lipcon <[email protected]>
Gerrit-Reviewer: Mike Percy <[email protected]>

Reply via email to