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

Unified Diff: runtime/vm/scavenger.cc

Issue 3000113002: WIP: idle scavenge (Closed)
Patch Set: . Created 3 years, 4 months 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 | « runtime/vm/scavenger.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/scavenger.cc
diff --git a/runtime/vm/scavenger.cc b/runtime/vm/scavenger.cc
index 959a7f35e7f0cd8c96d866e193a3543a22329fbc..abd9f24def279d43e82ce2b4e59eed29ed6b5d94 100644
--- a/runtime/vm/scavenger.cc
+++ b/runtime/vm/scavenger.cc
@@ -420,6 +420,7 @@ void Scavenger::Epilogue(Isolate* isolate,
// Remember the limit to which objects have been copied.
survivor_end_ = top_;
} else {
+ OS::Print("early tenuring!\n");
// Move survivor end to the end of the to_ space, making all surviving
// objects candidates for promotion next time.
survivor_end_ = end_;
@@ -842,6 +843,9 @@ void Scavenger::Scavenge(bool invoke_api_callbacks) {
// The API prologue/epilogue may create/destroy zones, so we must not
// depend on zone allocations surviving beyond the epilogue callback.
{
+ intptr_t scavenge_rate = ScavengeRateInBytesPerMicro();
+ intptr_t est_time = usage_before.used_in_words * kWordSize / scavenge_rate;
+
StackZone zone(thread);
// Setup the visitor and run the scavenge.
ScavengerVisitor visitor(isolate, this, from);
@@ -862,9 +866,33 @@ void Scavenger::Scavenge(bool invoke_api_callbacks) {
int64_t end = OS::GetCurrentMonotonicMicros();
heap_->RecordTime(kProcessToSpace, middle - start);
heap_->RecordTime(kIterateWeaks, end - middle);
+ SpaceUsage usage_after = GetCurrentUsage();
stats_history_.Add(ScavengeStats(
- start, end, usage_before, GetCurrentUsage(), promo_candidate_words,
+ start, end, usage_before, usage_after, promo_candidate_words,
visitor.bytes_promoted() >> kWordSizeLog2));
+
+ intptr_t size_before = usage_before.used_in_words * kWordSize;
+ intptr_t survivor_tenured = visitor.bytes_promoted();
+ intptr_t survivor_nontenured = usage_after.used_in_words * kWordSize;
+ intptr_t actual_time = end - start;
+
+ OS::Print("rate=%7" Pd "B/us, "
+ "size=%5" Pd "kB, "
+ "survivor=%lf, "
+ "tenured=%lf, "
+ "nontenured=%lf, "
+ "estimated=%5" Pd "ms, "
+ "actual=%5" Pd "ms, "
+ "headroom=%5" Pd "us\n",
+ scavenge_rate,
+ size_before / KB,
+ (double)(survivor_tenured+survivor_nontenured)/(double)size_before,
+ (double)(survivor_tenured)/(double)size_before,
+ (double)(survivor_nontenured)/(double)size_before,
+ est_time / 1000,
+ actual_time / 1000,
+ (est_time - actual_time)
+ );
}
Epilogue(isolate, from, invoke_api_callbacks);
« no previous file with comments | « runtime/vm/scavenger.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698