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

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

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 | « no previous file | src/heap/gc-tracer.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/heap/gc-tracer.h
diff --git a/src/heap/gc-tracer.h b/src/heap/gc-tracer.h
index 1fad040d91e1cc686bcecd37ee0b2fbe8ebb4db2..96e202006b1e8e8099b9d1f54f28d12ce3d5f997 100644
--- a/src/heap/gc-tracer.h
+++ b/src/heap/gc-tracer.h
@@ -178,6 +178,18 @@ class GCTracer {
};
+ class CompactionEvent {
+ public:
+ CompactionEvent() : duration(0), live_bytes_compacted(0) {}
+
+ CompactionEvent(double duration, intptr_t live_bytes_compacted)
+ : duration(duration), live_bytes_compacted(live_bytes_compacted) {}
+
+ double duration;
+ intptr_t live_bytes_compacted;
+ };
+
+
class ContextDisposalEvent {
public:
// Default constructor leaves the event uninitialized.
@@ -314,6 +326,8 @@ class GCTracer {
typedef RingBuffer<ContextDisposalEvent, kRingBufferMaxSize>
ContextDisposalEventBuffer;
+ typedef RingBuffer<CompactionEvent, kRingBufferMaxSize> CompactionEventBuffer;
+
typedef RingBuffer<SurvivalEvent, kRingBufferMaxSize> SurvivalEventBuffer;
static const int kThroughputTimeFrameMs = 5000;
@@ -336,6 +350,8 @@ class GCTracer {
void AddContextDisposalTime(double time);
+ void AddCompactionEvent(double duration, intptr_t live_bytes_compacted);
+
void AddSurvivalRatio(double survival_ratio);
// Log an incremental marking step.
@@ -406,6 +422,10 @@ class GCTracer {
intptr_t ScavengeSpeedInBytesPerMillisecond(
ScavengeSpeedMode mode = kForAllObjects) const;
+ // Compute the average compaction speed in bytes/millisecond.
+ // Returns 0 if not enough events have been recorded.
+ intptr_t CompactionSpeedInBytesPerMillisecond() const;
+
// Compute the average mark-sweep speed in bytes/millisecond.
// Returns 0 if no events have been recorded.
intptr_t MarkCompactSpeedInBytesPerMillisecond() const;
@@ -520,6 +540,9 @@ class GCTracer {
// RingBuffer for context disposal events.
ContextDisposalEventBuffer context_disposal_events_;
+ // RingBuffer for compaction events.
+ CompactionEventBuffer compaction_events_;
+
// RingBuffer for survival events.
SurvivalEventBuffer survival_events_;
« no previous file with comments | « no previous file | src/heap/gc-tracer.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698