Mike Percy has submitted this change and it was merged. ( http://gerrit.cloudera.org:8080/9894 )
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 Reviewed-on: http://gerrit.cloudera.org:8080/9894 Tested-by: Kudu Jenkins Reviewed-by: Adar Dembo <[email protected]> Reviewed-by: Mike Percy <[email protected]> --- 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(-) Approvals: Kudu Jenkins: Verified Adar Dembo: Looks good to me, approved Mike Percy: Looks good to me, approved -- 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: merged Gerrit-Change-Id: I3985433056aab163cc65972e94bc2108f00546a3 Gerrit-Change-Number: 9894 Gerrit-PatchSet: 2 Gerrit-Owner: Todd Lipcon <[email protected]> Gerrit-Reviewer: Adar Dembo <[email protected]> Gerrit-Reviewer: Kudu Jenkins Gerrit-Reviewer: Mike Percy <[email protected]> Gerrit-Reviewer: Tidy Bot
