Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(59)

Unified Diff: src/heap/gc-tracer.cc

Issue 1410633005: [heap] Base number of compaction tasks on live memory and compaction speed. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Restore 1st version of profiling evacuation performance Created 5 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/heap/gc-tracer.h ('k') | src/heap/mark-compact.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/heap/gc-tracer.cc
diff --git a/src/heap/gc-tracer.cc b/src/heap/gc-tracer.cc
index 2854e452f127488c6ecccacaf716b977a8d2ce35..a37b832358e3f90a3198668ac81f2d29f027d35c 100644
--- a/src/heap/gc-tracer.cc
+++ b/src/heap/gc-tracer.cc
@@ -309,6 +309,13 @@ void GCTracer::AddContextDisposalTime(double time) {
}
+void GCTracer::AddCompactionEvent(double duration,
+ intptr_t live_bytes_compacted) {
+ compaction_events_.push_front(
+ CompactionEvent(duration, live_bytes_compacted));
+}
+
+
void GCTracer::AddSurvivalRatio(double promotion_ratio) {
survival_events_.push_front(SurvivalEvent(promotion_ratio));
}
@@ -535,7 +542,8 @@ void GCTracer::PrintNVP() const {
"semi_space_copy_rate=%.1f%% "
"new_space_allocation_throughput=%" V8_PTR_PREFIX
"d "
- "context_disposal_rate=%.1f\n",
+ "context_disposal_rate=%.1f "
+ "compaction_speed=%" V8_PTR_PREFIX "d\n",
heap_->isolate()->time_millis_since_init(), duration,
spent_in_mutator, current_.TypeName(true),
current_.reduce_memory, current_.scopes[Scope::EXTERNAL],
@@ -585,7 +593,8 @@ void GCTracer::PrintNVP() const {
heap_->promotion_ratio_, AverageSurvivalRatio(),
heap_->promotion_rate_, heap_->semi_space_copied_rate_,
NewSpaceAllocationThroughputInBytesPerMillisecond(),
- ContextDisposalRateInMilliseconds());
+ ContextDisposalRateInMilliseconds(),
+ CompactionSpeedInBytesPerMillisecond());
break;
case Event::START:
break;
@@ -706,6 +715,23 @@ intptr_t GCTracer::ScavengeSpeedInBytesPerMillisecond(
}
+intptr_t GCTracer::CompactionSpeedInBytesPerMillisecond() const {
+ if (compaction_events_.size() < kRingBufferMaxSize) return 0.0;
+ intptr_t bytes = 0;
+ double durations = 0.0;
+ CompactionEventBuffer::const_iterator iter = compaction_events_.begin();
+ while (iter != compaction_events_.end()) {
+ bytes += iter->live_bytes_compacted;
+ durations += iter->duration;
+ ++iter;
+ }
+
+ if (durations == 0.0) return 0;
+ // Make sure the result is at least 1.
+ return Max<intptr_t>(static_cast<intptr_t>(bytes / durations + 0.5), 1);
+}
+
+
intptr_t GCTracer::MarkCompactSpeedInBytesPerMillisecond() const {
intptr_t bytes = 0;
double durations = 0.0;
« no previous file with comments | « src/heap/gc-tracer.h ('k') | src/heap/mark-compact.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698