[前][次][番号順一覧][スレッド一覧]

ruby-changes:29452

From: ko1 <ko1@a...>
Date: Fri, 21 Jun 2013 05:39:33 +0900 (JST)
Subject: [ruby-changes:29452] ko1:r41504 (trunk): * gc.c (gc_prof_sweep_timer_stop): accumulate sweep time only when

ko1	2013-06-21 05:39:20 +0900 (Fri, 21 Jun 2013)

  New Revision: 41504

  http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=rev&revision=41504

  Log:
    * gc.c (gc_prof_sweep_timer_stop): accumulate sweep time only when
      record->gc_time > 0.

  Modified files:
    trunk/ChangeLog
    trunk/gc.c

Index: ChangeLog
===================================================================
--- ChangeLog	(revision 41503)
+++ ChangeLog	(revision 41504)
@@ -1,3 +1,8 @@ https://github.com/ruby/ruby/blob/trunk/ChangeLog#L1
+Fri Jun 21 05:37:39 2013  Koichi Sasada  <ko1@a...>
+
+	* gc.c (gc_prof_sweep_timer_stop): accumulate sweep time only when
+	  record->gc_time > 0.
+
 Fri Jun 21 00:37:31 2013  Tanaka Akira  <akr@f...>
 
 	* ext/bigdecimal: Workaround fix for bigdecimal test failures caused
Index: gc.c
===================================================================
--- gc.c	(revision 41503)
+++ gc.c	(revision 41504)
@@ -5086,13 +5086,17 @@ gc_prof_sweep_timer_stop(rb_objspace_t * https://github.com/ruby/ruby/blob/trunk/gc.c#L5086
     }
     if (objspace->profile.run) {
 	double sweep_time;
+
 	gc_profile_record *record = gc_prof_record(objspace);
 
-	if (record->gc_time > 0 || GC_PROFILE_MORE_DETAIL) {
-	    /* need to accumulate for lazy sweep */
+	if (record->gc_time > 0) {
 	    sweep_time = elapsed_time_from(objspace->profile.gc_sweep_start_time);
+	    /* need to accumulate GC time for lazy sweep after gc() */
 	    record->gc_time += sweep_time;
 	}
+	else if (GC_PROFILE_MORE_DETAIL) {
+	    sweep_time = elapsed_time_from(objspace->profile.gc_sweep_start_time);
+	}
 
 #if GC_PROFILE_MORE_DETAIL
 	record->gc_sweep_time += sweep_time;

--
ML: ruby-changes@q...
Info: http://www.atdot.net/~ko1/quickml/

[前][次][番号順一覧][スレッド一覧]