Hello zhen.zhang, Adar Dembo,
I'd like you to do a code review. Please visit
http://gerrit.cloudera.org:8080/8445
to review the following change.
Change subject: compaction_policy: avoid a division in approximation algorithm
......................................................................
compaction_policy: avoid a division in approximation algorithm
This does some simple mathematical substitution to avoid an unnecessary
division instruction in the approximation algorithm in the compaction
policy. This provided a ~5% speedup:
Before:
Performance counter stats for 'build/latest/bin/compaction_policy-test
--gtest_filter=*TinyOver*' (10 runs):
426.861117 task-clock (msec) # 0.999 CPUs utilized
( +- 0.87% )
2 context-switches # 0.004 K/sec
( +- 23.13% )
0 cpu-migrations # 0.000 K/sec
2,476 page-faults # 0.006 M/sec
( +- 4.38% )
1,597,139,052 cycles # 3.742 GHz
( +- 0.67% )
4,013,990,056 instructions # 2.51 insn per cycle
( +- 0.01% )
628,035,462 branches # 1471.288 M/sec
( +- 0.01% )
2,408,063 branch-misses # 0.38% of all branches
( +- 0.13% )
0.427287921 seconds time elapsed
( +- 0.86% )
After:
Performance counter stats for 'build/latest/bin/compaction_policy-test
--gtest_filter=*TinyOver*' (10 runs):
404.664720 task-clock (msec) # 0.999 CPUs utilized
( +- 0.93% )
1 context-switches # 0.003 K/sec
( +- 28.21% )
0 cpu-migrations # 0.000 K/sec
2,531 page-faults # 0.006 M/sec
( +- 3.54% )
1,508,535,824 cycles # 3.728 GHz
( +- 0.22% )
3,916,607,007 instructions # 2.60 insn per cycle
( +- 0.01% )
628,048,996 branches # 1552.023 M/sec
( +- 0.01% )
2,380,872 branch-misses # 0.38% of all branches
( +- 0.08% )
0.404947434 seconds time elapsed
( +- 0.94% )
Change-Id: I018a81987744c35ff672765ac9e212fd3654638d
---
M src/kudu/tablet/compaction_policy.cc
1 file changed, 13 insertions(+), 3 deletions(-)
git pull ssh://gerrit.cloudera.org:29418/kudu refs/changes/45/8445/1
--
To view, visit http://gerrit.cloudera.org:8080/8445
To unsubscribe, visit http://gerrit.cloudera.org:8080/settings
Gerrit-Project: kudu
Gerrit-Branch: master
Gerrit-MessageType: newchange
Gerrit-Change-Id: I018a81987744c35ff672765ac9e212fd3654638d
Gerrit-Change-Number: 8445
Gerrit-PatchSet: 1
Gerrit-Owner: Todd Lipcon <[email protected]>
Gerrit-Reviewer: Adar Dembo <[email protected]>
Gerrit-Reviewer: zhen.zhang <[email protected]>