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

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

Issue 410413005: Add event statistics to GCTracer. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Fix comments. Created 6 years, 5 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « src/gc-tracer.h ('k') | 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/v8.h" 5 #include "src/v8.h"
6 6
7 #include "src/gc-tracer.h" 7 #include "src/gc-tracer.h"
8 8
9 namespace v8 { 9 namespace v8 {
10 namespace internal { 10 namespace internal {
(...skipping 250 matching lines...) Expand 10 before | Expand all | Expand 10 after
261 current_.incremental_marking_steps - 261 current_.incremental_marking_steps -
262 previous_mark_compactor_event_.incremental_marking_steps); 262 previous_mark_compactor_event_.incremental_marking_steps);
263 PrintF("stepstook=%.1f ", 263 PrintF("stepstook=%.1f ",
264 current_.incremental_marking_duration - 264 current_.incremental_marking_duration -
265 previous_mark_compactor_event_.incremental_marking_duration); 265 previous_mark_compactor_event_.incremental_marking_duration);
266 PrintF("longeststep=%.1f ", current_.longest_incremental_marking_step); 266 PrintF("longeststep=%.1f ", current_.longest_incremental_marking_step);
267 } 267 }
268 268
269 PrintF("\n"); 269 PrintF("\n");
270 } 270 }
271
272
273 double GCTracer::MeanDuration(const EventBuffer& events) const {
274 if (events.empty()) return 0.0;
275
276 double mean = 0.0;
277 EventBuffer::const_iterator iter = events.begin();
278 while (iter != events.end()) {
279 mean += iter->end_time - iter->start_time;
280 ++iter;
281 }
282
283 return mean / events.size();
284 }
285
286
287 double GCTracer::MaxDuration(const EventBuffer& events) const {
288 if (events.empty()) return 0.0;
289
290 double maximum = 0.0f;
291 EventBuffer::const_iterator iter = events.begin();
292 while (iter != events.end()) {
293 maximum = Max(iter->end_time - iter->start_time, maximum);
294 ++iter;
295 }
296
297 return maximum;
298 }
299
300
301 double GCTracer::MeanIncrementalMarkingDuration() const {
302 if (mark_compactor_events_.empty()) return 0.0;
303
304 EventBuffer::const_iterator last_mc = mark_compactor_events_.begin();
305 return last_mc->incremental_marking_duration /
306 last_mc->incremental_marking_steps;
307 }
308
309
310 double GCTracer::MaxIncrementalMarkingDuration() const {
311 if (mark_compactor_events_.empty()) return 0.0;
312
313 EventBuffer::const_iterator last_mc = mark_compactor_events_.begin();
314 return last_mc->longest_incremental_marking_step;
315 }
271 } 316 }
272 } // namespace v8::internal 317 } // namespace v8::internal
OLDNEW
« no previous file with comments | « src/gc-tracer.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698