Revision: 23195
Author: [email protected]
Date: Tue Aug 19 12:07:59 2014 UTC
Log: Trace scavenger throughput.
BUG=
[email protected]
Review URL: https://codereview.chromium.org/487753003
http://code.google.com/p/v8/source/detail?r=23195
Modified:
/branches/bleeding_edge/src/heap/gc-tracer.cc
/branches/bleeding_edge/src/heap/gc-tracer.h
=======================================
--- /branches/bleeding_edge/src/heap/gc-tracer.cc Mon Aug 11 12:46:03 2014
UTC
+++ /branches/bleeding_edge/src/heap/gc-tracer.cc Tue Aug 19 12:07:59 2014
UTC
@@ -103,6 +103,8 @@
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_;
@@ -296,6 +298,8 @@
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);
@@ -393,6 +397,22 @@
durations += iter->pure_incremental_marking_duration;
++iter;
}
+
+ if (durations == 0.0) return 0;
+
+ 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;
=======================================
--- /branches/bleeding_edge/src/heap/gc-tracer.h Mon Aug 11 12:46:03 2014
UTC
+++ /branches/bleeding_edge/src/heap/gc-tracer.h Tue Aug 19 12:07:59 2014
UTC
@@ -171,6 +171,9 @@
// 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;
@@ -280,10 +283,14 @@
// 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.
--
--
v8-dev mailing list
[email protected]
http://groups.google.com/group/v8-dev
---
You received this message because you are subscribed to the Google Groups "v8-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
For more options, visit https://groups.google.com/d/optout.