make PerfStepTimer struct smaller by reordering members (#7931)

Summary:
On x86_64, this makes the struct 8 bytes smaller, so creating a PerfStepTimer on the stack will use slightly less stack space.

Pull Request resolved: https://github.com/facebook/rocksdb/pull/7931

Reviewed By: jay-zhuang

Differential Revision: D26529470

Pulled By: ajkr

fbshipit-source-id: bbe2e843167152ffa05a5946f1add6621c9849f7
main
jsteemann 3 years ago committed by Facebook GitHub Bot
parent ef392fb04e
commit 02974c9437
  1. 6
      monitoring/perf_step_timer.h

@ -18,13 +18,13 @@ class PerfStepTimer {
Statistics* statistics = nullptr, uint32_t ticker_type = 0)
: perf_counter_enabled_(perf_level >= enable_level),
use_cpu_time_(use_cpu_time),
ticker_type_(ticker_type),
clock_((perf_counter_enabled_ || statistics != nullptr)
? (clock ? clock : SystemClock::Default().get())
: nullptr),
start_(0),
metric_(metric),
statistics_(statistics),
ticker_type_(ticker_type) {}
statistics_(statistics) {}
~PerfStepTimer() {
Stop();
@ -69,11 +69,11 @@ class PerfStepTimer {
const bool perf_counter_enabled_;
const bool use_cpu_time_;
uint32_t ticker_type_;
SystemClock* const clock_;
uint64_t start_;
uint64_t* metric_;
Statistics* statistics_;
uint32_t ticker_type_;
};
} // namespace ROCKSDB_NAMESPACE

Loading…
Cancel
Save