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

Side by Side Diff: src/heap/gc-tracer.cc

Issue 1440423002: [heap] Do not require kRingBufferMaxSize samples for estimating compaction speed (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: 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 | no next file » | 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 #include "src/heap/gc-tracer.h" 5 #include "src/heap/gc-tracer.h"
6 6
7 #include "src/counters.h" 7 #include "src/counters.h"
8 #include "src/heap/heap-inl.h" 8 #include "src/heap/heap-inl.h"
9 #include "src/isolate.h" 9 #include "src/isolate.h"
10 10
(...skipping 713 matching lines...) Expand 10 before | Expand all | Expand 10 after
724 ++iter; 724 ++iter;
725 } 725 }
726 726
727 if (durations == 0.0) return 0; 727 if (durations == 0.0) return 0;
728 // Make sure the result is at least 1. 728 // Make sure the result is at least 1.
729 return Max<size_t>(static_cast<size_t>(bytes / durations + 0.5), 1); 729 return Max<size_t>(static_cast<size_t>(bytes / durations + 0.5), 1);
730 } 730 }
731 731
732 732
733 intptr_t GCTracer::CompactionSpeedInBytesPerMillisecond() const { 733 intptr_t GCTracer::CompactionSpeedInBytesPerMillisecond() const {
734 if (compaction_events_.size() < kRingBufferMaxSize) return 0; 734 if (compaction_events_.size() == 0) return 0;
735 intptr_t bytes = 0; 735 intptr_t bytes = 0;
736 double durations = 0.0; 736 double durations = 0.0;
737 CompactionEventBuffer::const_iterator iter = compaction_events_.begin(); 737 CompactionEventBuffer::const_iterator iter = compaction_events_.begin();
738 while (iter != compaction_events_.end()) { 738 while (iter != compaction_events_.end()) {
739 bytes += iter->live_bytes_compacted; 739 bytes += iter->live_bytes_compacted;
740 durations += iter->duration; 740 durations += iter->duration;
741 ++iter; 741 ++iter;
742 } 742 }
743 743
744 if (durations == 0.0) return 0; 744 if (durations == 0.0) return 0;
(...skipping 147 matching lines...) Expand 10 before | Expand all | Expand 10 after
892 892
893 893
894 bool GCTracer::SurvivalEventsRecorded() const { 894 bool GCTracer::SurvivalEventsRecorded() const {
895 return survival_events_.size() > 0; 895 return survival_events_.size() > 0;
896 } 896 }
897 897
898 898
899 void GCTracer::ResetSurvivalEvents() { survival_events_.reset(); } 899 void GCTracer::ResetSurvivalEvents() { survival_events_.reset(); }
900 } // namespace internal 900 } // namespace internal
901 } // namespace v8 901 } // namespace v8
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698