Commit 1efd68d9 authored by hpayer@chromium.org's avatar hpayer@chromium.org

Measure incremental marking speed in bytes per millisecond based on pure incremental marking steps.

BUG=
R=jochen@chromium.org

Review URL: https://codereview.chromium.org/463453002

git-svn-id: https://v8.googlecode.com/svn/branches/bleeding_edge@23035 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
parent dd28ee3b
......@@ -38,6 +38,8 @@ GCTracer::Event::Event(Type type, const char* gc_reason,
incremental_marking_bytes(0),
cumulative_incremental_marking_duration(0.0),
incremental_marking_duration(0.0),
cumulative_pure_incremental_marking_duration(0.0),
pure_incremental_marking_duration(0.0),
longest_incremental_marking_step(0.0) {
for (int i = 0; i < Scope::NUMBER_OF_SCOPES; i++) {
scopes[i] = 0;
......@@ -75,6 +77,7 @@ GCTracer::GCTracer(Heap* heap)
cumulative_incremental_marking_steps_(0),
cumulative_incremental_marking_bytes_(0),
cumulative_incremental_marking_duration_(0.0),
cumulative_pure_incremental_marking_duration_(0.0),
longest_incremental_marking_step_(0.0),
cumulative_marking_duration_(0.0),
cumulative_sweeping_duration_(0.0) {
......@@ -107,6 +110,8 @@ void GCTracer::Start(GarbageCollector collector, const char* gc_reason,
cumulative_incremental_marking_bytes_;
current_.cumulative_incremental_marking_duration =
cumulative_incremental_marking_duration_;
current_.cumulative_pure_incremental_marking_duration =
cumulative_pure_incremental_marking_duration_;
current_.longest_incremental_marking_step = longest_incremental_marking_step_;
for (int i = 0; i < Scope::NUMBER_OF_SCOPES; i++) {
......@@ -131,6 +136,9 @@ void GCTracer::Stop() {
current_.incremental_marking_duration =
current_.cumulative_incremental_marking_duration -
previous_.cumulative_incremental_marking_duration;
current_.pure_incremental_marking_duration =
current_.cumulative_pure_incremental_marking_duration -
previous_.cumulative_pure_incremental_marking_duration;
scavenger_events_.push_front(current_);
} else {
current_.incremental_marking_steps =
......@@ -142,6 +150,10 @@ void GCTracer::Stop() {
current_.incremental_marking_duration =
current_.cumulative_incremental_marking_duration -
previous_mark_compactor_event_.cumulative_incremental_marking_duration;
current_.pure_incremental_marking_duration =
current_.cumulative_pure_incremental_marking_duration -
previous_mark_compactor_event_
.cumulative_pure_incremental_marking_duration;
longest_incremental_marking_step_ = 0.0;
mark_compactor_events_.push_front(current_);
}
......@@ -177,6 +189,9 @@ void GCTracer::AddIncrementalMarkingStep(double duration, intptr_t bytes) {
longest_incremental_marking_step_ =
Max(longest_incremental_marking_step_, duration);
cumulative_marking_duration_ += duration;
if (bytes > 0) {
cumulative_pure_incremental_marking_duration_ += duration;
}
}
......@@ -367,7 +382,7 @@ intptr_t GCTracer::IncrementalMarkingSpeedInBytesPerMillisecond() const {
// Use data from GCTracer instead of data from event buffers.
if (mark_compactor_events_.empty()) {
return static_cast<intptr_t>(cumulative_incremental_marking_bytes_ /
cumulative_incremental_marking_duration_);
cumulative_pure_incremental_marking_duration_);
}
intptr_t bytes = 0;
......@@ -375,7 +390,7 @@ intptr_t GCTracer::IncrementalMarkingSpeedInBytesPerMillisecond() const {
EventBuffer::const_iterator iter = mark_compactor_events_.begin();
while (iter != mark_compactor_events_.end()) {
bytes += iter->incremental_marking_bytes;
durations += iter->incremental_marking_duration;
durations += iter->pure_incremental_marking_duration;
++iter;
}
......
......@@ -197,6 +197,15 @@ class GCTracer BASE_EMBEDDED {
// - last MARK_COMPACTOR event for MARK_COMPACTOR events
double incremental_marking_duration;
// Cumulative pure duration of incremental marking steps since creation of
// tracer. (value at start of event)
double cumulative_pure_incremental_marking_duration;
// Duration of pure incremental marking steps since
// - last event for SCAVENGER events
// - last MARK_COMPACTOR event for MARK_COMPACTOR events
double pure_incremental_marking_duration;
// Longest incremental marking step since start of marking.
// (value at start of event)
double longest_incremental_marking_step;
......@@ -319,6 +328,10 @@ class GCTracer BASE_EMBEDDED {
// Cumulative duration of incremental marking steps since creation of tracer.
double cumulative_incremental_marking_duration_;
// Cumulative duration of pure incremental marking steps since creation of
// tracer.
double cumulative_pure_incremental_marking_duration_;
// Longest incremental marking step since start of marking.
double longest_incremental_marking_step_;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment