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

Side by Side 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 unified diff | Download patch
« no previous file with comments | « no previous file | src/heap/gc-tracer.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2014 the V8 project authors. All rights reserved. 1 // Copyright 2014 the V8 project authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #ifndef V8_HEAP_GC_TRACER_H_ 5 #ifndef V8_HEAP_GC_TRACER_H_
6 #define V8_HEAP_GC_TRACER_H_ 6 #define V8_HEAP_GC_TRACER_H_
7 7
8 #include "src/base/platform/platform.h" 8 #include "src/base/platform/platform.h"
9 #include "src/globals.h" 9 #include "src/globals.h"
10 10
(...skipping 160 matching lines...) Expand 10 before | Expand all | Expand 10 after
171 // Time spent in the mutator during the end of the last sample to the 171 // Time spent in the mutator during the end of the last sample to the
172 // beginning of the next sample. 172 // beginning of the next sample.
173 double duration_; 173 double duration_;
174 174
175 // Memory allocated in the new space during the end of the last sample 175 // Memory allocated in the new space during the end of the last sample
176 // to the beginning of the next sample 176 // to the beginning of the next sample
177 size_t allocation_in_bytes_; 177 size_t allocation_in_bytes_;
178 }; 178 };
179 179
180 180
181 class CompactionEvent {
182 public:
183 CompactionEvent() : duration(0), live_bytes_compacted(0) {}
184
185 CompactionEvent(double duration, intptr_t live_bytes_compacted)
186 : duration(duration), live_bytes_compacted(live_bytes_compacted) {}
187
188 double duration;
189 intptr_t live_bytes_compacted;
190 };
191
192
181 class ContextDisposalEvent { 193 class ContextDisposalEvent {
182 public: 194 public:
183 // Default constructor leaves the event uninitialized. 195 // Default constructor leaves the event uninitialized.
184 ContextDisposalEvent() {} 196 ContextDisposalEvent() {}
185 197
186 explicit ContextDisposalEvent(double time); 198 explicit ContextDisposalEvent(double time);
187 199
188 // Time when context disposal event happened. 200 // Time when context disposal event happened.
189 double time_; 201 double time_;
190 }; 202 };
(...skipping 116 matching lines...) Expand 10 before | Expand all | Expand 10 after
307 319
308 static const size_t kRingBufferMaxSize = 10; 320 static const size_t kRingBufferMaxSize = 10;
309 321
310 typedef RingBuffer<Event, kRingBufferMaxSize> EventBuffer; 322 typedef RingBuffer<Event, kRingBufferMaxSize> EventBuffer;
311 323
312 typedef RingBuffer<AllocationEvent, kRingBufferMaxSize> AllocationEventBuffer; 324 typedef RingBuffer<AllocationEvent, kRingBufferMaxSize> AllocationEventBuffer;
313 325
314 typedef RingBuffer<ContextDisposalEvent, kRingBufferMaxSize> 326 typedef RingBuffer<ContextDisposalEvent, kRingBufferMaxSize>
315 ContextDisposalEventBuffer; 327 ContextDisposalEventBuffer;
316 328
329 typedef RingBuffer<CompactionEvent, kRingBufferMaxSize> CompactionEventBuffer;
330
317 typedef RingBuffer<SurvivalEvent, kRingBufferMaxSize> SurvivalEventBuffer; 331 typedef RingBuffer<SurvivalEvent, kRingBufferMaxSize> SurvivalEventBuffer;
318 332
319 static const int kThroughputTimeFrameMs = 5000; 333 static const int kThroughputTimeFrameMs = 5000;
320 334
321 explicit GCTracer(Heap* heap); 335 explicit GCTracer(Heap* heap);
322 336
323 // Start collecting data. 337 // Start collecting data.
324 void Start(GarbageCollector collector, const char* gc_reason, 338 void Start(GarbageCollector collector, const char* gc_reason,
325 const char* collector_reason); 339 const char* collector_reason);
326 340
327 // Stop collecting data and print results. 341 // Stop collecting data and print results.
328 void Stop(GarbageCollector collector); 342 void Stop(GarbageCollector collector);
329 343
330 // Sample and accumulate bytes allocated since the last GC. 344 // Sample and accumulate bytes allocated since the last GC.
331 void SampleAllocation(double current_ms, size_t new_space_counter_bytes, 345 void SampleAllocation(double current_ms, size_t new_space_counter_bytes,
332 size_t old_generation_counter_bytes); 346 size_t old_generation_counter_bytes);
333 347
334 // Log the accumulated new space allocation bytes. 348 // Log the accumulated new space allocation bytes.
335 void AddAllocation(double current_ms); 349 void AddAllocation(double current_ms);
336 350
337 void AddContextDisposalTime(double time); 351 void AddContextDisposalTime(double time);
338 352
353 void AddCompactionEvent(double duration, intptr_t live_bytes_compacted);
354
339 void AddSurvivalRatio(double survival_ratio); 355 void AddSurvivalRatio(double survival_ratio);
340 356
341 // Log an incremental marking step. 357 // Log an incremental marking step.
342 void AddIncrementalMarkingStep(double duration, intptr_t bytes); 358 void AddIncrementalMarkingStep(double duration, intptr_t bytes);
343 359
344 // Log time spent in marking. 360 // Log time spent in marking.
345 void AddMarkingTime(double duration) { 361 void AddMarkingTime(double duration) {
346 cumulative_marking_duration_ += duration; 362 cumulative_marking_duration_ += duration;
347 } 363 }
348 364
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after
399 415
400 // Compute the average incremental marking speed in bytes/millisecond. 416 // Compute the average incremental marking speed in bytes/millisecond.
401 // Returns 0 if no events have been recorded. 417 // Returns 0 if no events have been recorded.
402 intptr_t IncrementalMarkingSpeedInBytesPerMillisecond() const; 418 intptr_t IncrementalMarkingSpeedInBytesPerMillisecond() const;
403 419
404 // Compute the average scavenge speed in bytes/millisecond. 420 // Compute the average scavenge speed in bytes/millisecond.
405 // Returns 0 if no events have been recorded. 421 // Returns 0 if no events have been recorded.
406 intptr_t ScavengeSpeedInBytesPerMillisecond( 422 intptr_t ScavengeSpeedInBytesPerMillisecond(
407 ScavengeSpeedMode mode = kForAllObjects) const; 423 ScavengeSpeedMode mode = kForAllObjects) const;
408 424
425 // Compute the average compaction speed in bytes/millisecond.
426 // Returns 0 if not enough events have been recorded.
427 intptr_t CompactionSpeedInBytesPerMillisecond() const;
428
409 // Compute the average mark-sweep speed in bytes/millisecond. 429 // Compute the average mark-sweep speed in bytes/millisecond.
410 // Returns 0 if no events have been recorded. 430 // Returns 0 if no events have been recorded.
411 intptr_t MarkCompactSpeedInBytesPerMillisecond() const; 431 intptr_t MarkCompactSpeedInBytesPerMillisecond() const;
412 432
413 // Compute the average incremental mark-sweep finalize speed in 433 // Compute the average incremental mark-sweep finalize speed in
414 // bytes/millisecond. 434 // bytes/millisecond.
415 // Returns 0 if no events have been recorded. 435 // Returns 0 if no events have been recorded.
416 intptr_t FinalIncrementalMarkCompactSpeedInBytesPerMillisecond() const; 436 intptr_t FinalIncrementalMarkCompactSpeedInBytesPerMillisecond() const;
417 437
418 // Compute the overall mark compact speed including incremental steps 438 // Compute the overall mark compact speed including incremental steps
(...skipping 94 matching lines...) Expand 10 before | Expand all | Expand 10 after
513 // RingBuffers for INCREMENTAL_MARK_COMPACTOR events. 533 // RingBuffers for INCREMENTAL_MARK_COMPACTOR events.
514 EventBuffer incremental_mark_compactor_events_; 534 EventBuffer incremental_mark_compactor_events_;
515 535
516 // RingBuffer for allocation events. 536 // RingBuffer for allocation events.
517 AllocationEventBuffer new_space_allocation_events_; 537 AllocationEventBuffer new_space_allocation_events_;
518 AllocationEventBuffer old_generation_allocation_events_; 538 AllocationEventBuffer old_generation_allocation_events_;
519 539
520 // RingBuffer for context disposal events. 540 // RingBuffer for context disposal events.
521 ContextDisposalEventBuffer context_disposal_events_; 541 ContextDisposalEventBuffer context_disposal_events_;
522 542
543 // RingBuffer for compaction events.
544 CompactionEventBuffer compaction_events_;
545
523 // RingBuffer for survival events. 546 // RingBuffer for survival events.
524 SurvivalEventBuffer survival_events_; 547 SurvivalEventBuffer survival_events_;
525 548
526 // Cumulative number of incremental marking steps since creation of tracer. 549 // Cumulative number of incremental marking steps since creation of tracer.
527 int cumulative_incremental_marking_steps_; 550 int cumulative_incremental_marking_steps_;
528 551
529 // Cumulative size of incremental marking steps (in bytes) since creation of 552 // Cumulative size of incremental marking steps (in bytes) since creation of
530 // tracer. 553 // tracer.
531 intptr_t cumulative_incremental_marking_bytes_; 554 intptr_t cumulative_incremental_marking_bytes_;
532 555
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after
567 590
568 // Counts how many tracers were started without stopping. 591 // Counts how many tracers were started without stopping.
569 int start_counter_; 592 int start_counter_;
570 593
571 DISALLOW_COPY_AND_ASSIGN(GCTracer); 594 DISALLOW_COPY_AND_ASSIGN(GCTracer);
572 }; 595 };
573 } // namespace internal 596 } // namespace internal
574 } // namespace v8 597 } // namespace v8
575 598
576 #endif // V8_HEAP_GC_TRACER_H_ 599 #endif // V8_HEAP_GC_TRACER_H_
OLDNEW
« 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