More Gc statistics and logging
Added a few metrics to Gc performance measurements:
Mean GC throughput, total time spent in Gc, total time spent in allocation code, mean time per allocation.
Slightly optimized object allocation.
Change-Id: Ie68153a7100affafc4a01dab34b341077e754867
diff --git a/src/timing_logger.h b/src/timing_logger.h
index 5bc9d71..7dc2671 100644
--- a/src/timing_logger.h
+++ b/src/timing_logger.h
@@ -170,7 +170,7 @@
<< FormatDuration(std_dev * kAdjust, tu) << " " << labels_[i] << "\n";
}
uint64_t total_mean_x2 = total_time_squared_;
- uint64_t mean_total_ns = GetTotalNs();
+ uint64_t mean_total_ns = GetTotalTime();
if (iterations_ != 0) {
total_mean_x2 /= iterations_;
mean_total_ns /= iterations_;
@@ -183,6 +183,12 @@
}
uint64_t GetTotalNs() const {
+ return GetTotalTime() * kAdjust;
+ }
+
+ private:
+
+ uint64_t GetTotalTime() const {
uint64_t total = 0;
for (size_t i = 0; i < times_.size(); ++i) {
total += times_[i];
@@ -190,7 +196,6 @@
return total;
}
- private:
static const uint64_t kAdjust = 1000;
std::string name_;
bool precise_;