current_.start_object_size = heap_->SizeOfObjects();
current_.start_memory_size = heap_->isolate()->memory_allocator()->Size();
current_.start_holes_size = CountTotalHolesSize(heap_);
+ current_.new_space_object_size =
+ heap_->new_space()->top() - heap_->new_space()->bottom();
current_.cumulative_incremental_marking_steps =
cumulative_incremental_marking_steps_;
if (current_.type == Event::SCAVENGER) {
PrintF("steps_count=%d ", current_.incremental_marking_steps);
PrintF("steps_took=%.1f ", current_.incremental_marking_duration);
+ PrintF("scavenge_throughput=%" V8_PTR_PREFIX "d ",
+ ScavengeSpeedInBytesPerMillisecond());
} else {
PrintF("steps_count=%d ", current_.incremental_marking_steps);
PrintF("steps_took=%.1f ", current_.incremental_marking_duration);
return static_cast<intptr_t>(bytes / durations);
}
+
+
+intptr_t GCTracer::ScavengeSpeedInBytesPerMillisecond() const {
+ intptr_t bytes = 0;
+ double durations = 0.0;
+ EventBuffer::const_iterator iter = scavenger_events_.begin();
+ while (iter != scavenger_events_.end()) {
+ bytes += iter->new_space_object_size;
+ durations += iter->end_time - iter->start_time;
+ ++iter;
+ }
+
+ if (durations == 0.0) return 0;
+
+ return static_cast<intptr_t>(bytes / durations);
+}
}
} // namespace v8::internal
// after the current GC.
intptr_t end_holes_size;
+ // Size of new space objects in constructor.
+ intptr_t new_space_object_size;
+
// Number of incremental marking steps since creation of tracer.
// (value at start of event)
int cumulative_incremental_marking_steps;
// Returns 0 if no incremental marking round has been completed.
double MaxIncrementalMarkingDuration() const;
- // Compute the average incremental marking speed in bytes/second. Returns 0 if
- // no events have been recorded.
+ // Compute the average incremental marking speed in bytes/millisecond.
+ // Returns 0 if no events have been recorded.
intptr_t IncrementalMarkingSpeedInBytesPerMillisecond() const;
+ // Compute the average scavenge speed in bytes/millisecond.
+ // Returns 0 if no events have been recorded.
+ intptr_t ScavengeSpeedInBytesPerMillisecond() const;
+
private:
// Print one detailed trace line in name=value format.
// TODO(ernstm): Move to Heap.