* gc.c: GC::Profiler's sweeping time is accumulated all slot
sweeping time. At lazy GC, GC::Profiler makes new record entry for each lazy_sweep(). In this change, accumulating all slot_sweep() time. And change indentation. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@40876 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
0fd2c7e67b
commit
2e011442e5
@ -1,3 +1,11 @@
|
|||||||
|
Tue May 21 16:45:31 2013 Koichi Sasada <ko1@atdot.net>
|
||||||
|
|
||||||
|
* gc.c: GC::Profiler's sweeping time is accumulated all slot
|
||||||
|
sweeping time. At lazy GC, GC::Profiler makes new record entry
|
||||||
|
for each lazy_sweep(). In this change, accumulating all
|
||||||
|
slot_sweep() time.
|
||||||
|
And change indentation.
|
||||||
|
|
||||||
Tue May 21 16:29:09 2013 Koichi Sasada <ko1@atdot.net>
|
Tue May 21 16:29:09 2013 Koichi Sasada <ko1@atdot.net>
|
||||||
|
|
||||||
* common.mk (rdoc-bench): add a benchmark rule
|
* common.mk (rdoc-bench): add a benchmark rule
|
||||||
|
30
gc.c
30
gc.c
@ -2171,7 +2171,7 @@ static void
|
|||||||
slot_sweep(rb_objspace_t *objspace, struct heaps_slot *sweep_slot)
|
slot_sweep(rb_objspace_t *objspace, struct heaps_slot *sweep_slot)
|
||||||
{
|
{
|
||||||
gc_prof_sweep_slot_timer_start(objspace);
|
gc_prof_sweep_slot_timer_start(objspace);
|
||||||
|
{
|
||||||
#if USE_RGENGC
|
#if USE_RGENGC
|
||||||
if (objspace->rgengc.during_minor_gc) {
|
if (objspace->rgengc.during_minor_gc) {
|
||||||
slot_sweep_minor(objspace, sweep_slot);
|
slot_sweep_minor(objspace, sweep_slot);
|
||||||
@ -2182,7 +2182,7 @@ slot_sweep(rb_objspace_t *objspace, struct heaps_slot *sweep_slot)
|
|||||||
#else
|
#else
|
||||||
slot_sweep_body(objspace, sweep_slot, FALSE);
|
slot_sweep_body(objspace, sweep_slot, FALSE);
|
||||||
#endif
|
#endif
|
||||||
|
}
|
||||||
gc_prof_sweep_slot_timer_stop(objspace);
|
gc_prof_sweep_slot_timer_stop(objspace);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -2313,13 +2313,10 @@ gc_prepare_free_objects(rb_objspace_t *objspace)
|
|||||||
if (!ready_to_gc(objspace)) return TRUE;
|
if (!ready_to_gc(objspace)) return TRUE;
|
||||||
|
|
||||||
during_gc++;
|
during_gc++;
|
||||||
gc_prof_timer_start(objspace);
|
|
||||||
|
|
||||||
if (objspace->heap.sweep_slots) {
|
if (objspace->heap.sweep_slots) {
|
||||||
res = lazy_sweep(objspace);
|
res = lazy_sweep(objspace);
|
||||||
if (res) {
|
if (res) {
|
||||||
gc_prof_set_malloc_info(objspace);
|
|
||||||
gc_prof_timer_stop(objspace, Qfalse);
|
|
||||||
return res;
|
return res;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -2330,10 +2327,11 @@ gc_prepare_free_objects(rb_objspace_t *objspace)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
gc_prof_timer_start(objspace);
|
||||||
|
{
|
||||||
gc_marks(objspace, TRUE);
|
gc_marks(objspace, TRUE);
|
||||||
|
|
||||||
before_gc_sweep(objspace);
|
before_gc_sweep(objspace);
|
||||||
|
|
||||||
if (!(res = lazy_sweep(objspace))) {
|
if (!(res = lazy_sweep(objspace))) {
|
||||||
/* there is no freespace after slot_sweep() */
|
/* there is no freespace after slot_sweep() */
|
||||||
while (1) {
|
while (1) {
|
||||||
@ -2350,7 +2348,7 @@ gc_prepare_free_objects(rb_objspace_t *objspace)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
gc_prof_timer_stop(objspace, Qtrue);
|
gc_prof_timer_stop(objspace, Qtrue);
|
||||||
return res;
|
return res;
|
||||||
}
|
}
|
||||||
@ -3339,7 +3337,6 @@ gc_marks_body(rb_objspace_t *objspace, rb_thread_t *th)
|
|||||||
gc_mark_stacked_objects(objspace);
|
gc_mark_stacked_objects(objspace);
|
||||||
|
|
||||||
/* cleanup */
|
/* cleanup */
|
||||||
gc_prof_mark_timer_stop(objspace);
|
|
||||||
rgengc_report(1, objspace, "gc_marks_body: end.\n");
|
rgengc_report(1, objspace, "gc_marks_body: end.\n");
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -3409,11 +3406,12 @@ gc_marks(rb_objspace_t *objspace, int minor_gc)
|
|||||||
struct mark_func_data_struct *prev_mark_func_data;
|
struct mark_func_data_struct *prev_mark_func_data;
|
||||||
rb_thread_t *th = GET_THREAD();
|
rb_thread_t *th = GET_THREAD();
|
||||||
|
|
||||||
|
gc_prof_mark_timer_start(objspace);
|
||||||
|
{
|
||||||
/* setup marking */
|
/* setup marking */
|
||||||
prev_mark_func_data = objspace->mark_func_data;
|
prev_mark_func_data = objspace->mark_func_data;
|
||||||
objspace->mark_func_data = 0;
|
objspace->mark_func_data = 0;
|
||||||
|
|
||||||
gc_prof_mark_timer_start(objspace);
|
|
||||||
objspace->count++;
|
objspace->count++;
|
||||||
|
|
||||||
SET_STACK_END;
|
SET_STACK_END;
|
||||||
@ -3432,6 +3430,8 @@ gc_marks(rb_objspace_t *objspace, int minor_gc)
|
|||||||
|
|
||||||
objspace->mark_func_data = prev_mark_func_data;
|
objspace->mark_func_data = prev_mark_func_data;
|
||||||
}
|
}
|
||||||
|
gc_prof_mark_timer_stop(objspace);
|
||||||
|
}
|
||||||
|
|
||||||
/* RGENGC */
|
/* RGENGC */
|
||||||
|
|
||||||
@ -3689,16 +3689,16 @@ garbage_collect(rb_objspace_t *objspace)
|
|||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
gc_prof_timer_start(objspace);
|
|
||||||
|
|
||||||
rest_sweep(objspace);
|
rest_sweep(objspace);
|
||||||
|
|
||||||
|
gc_prof_timer_start(objspace);
|
||||||
|
{
|
||||||
during_gc++;
|
during_gc++;
|
||||||
gc_marks(objspace, FALSE);
|
gc_marks(objspace, FALSE);
|
||||||
|
|
||||||
gc_sweep(objspace);
|
gc_sweep(objspace);
|
||||||
|
}
|
||||||
gc_prof_timer_stop(objspace, Qtrue);
|
gc_prof_timer_stop(objspace, Qtrue);
|
||||||
|
|
||||||
if (GC_NOTIFY) printf("end garbage_collect()\n");
|
if (GC_NOTIFY) printf("end garbage_collect()\n");
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
@ -4782,7 +4782,7 @@ gc_prof_sweep_slot_timer_stop(rb_objspace_t *objspace)
|
|||||||
|
|
||||||
sweep_time = getrusage_time() - objspace->profile.gc_sweep_start_time;
|
sweep_time = getrusage_time() - objspace->profile.gc_sweep_start_time;
|
||||||
if (sweep_time < 0) sweep_time = 0;
|
if (sweep_time < 0) sweep_time = 0;
|
||||||
record->gc_sweep_time = sweep_time;
|
record->gc_sweep_time += sweep_time;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -4956,7 +4956,7 @@ gc_profile_dump_on(VALUE out, VALUE (*append)(VALUE, VALUE))
|
|||||||
"Index Allocate Increase Allocate Limit Use Slot Have Finalize Mark Time(ms) Sweep Time(ms)\n"));
|
"Index Allocate Increase Allocate Limit Use Slot Have Finalize Mark Time(ms) Sweep Time(ms)\n"));
|
||||||
index = 1;
|
index = 1;
|
||||||
for (i = 0; i < count; i++) {
|
for (i = 0; i < count; i++) {
|
||||||
r = objspace->profile.record[i];
|
record = &objspace->profile.record[i];
|
||||||
append(out, rb_sprintf("%5d %17"PRIuSIZE" %17"PRIuSIZE" %9"PRIuSIZE" %14s %25.20f %25.20f\n",
|
append(out, rb_sprintf("%5d %17"PRIuSIZE" %17"PRIuSIZE" %9"PRIuSIZE" %14s %25.20f %25.20f\n",
|
||||||
index++, record->allocate_increase, record->allocate_limit,
|
index++, record->allocate_increase, record->allocate_limit,
|
||||||
record->heap_use_slots, (record->have_finalize ? "true" : "false"),
|
record->heap_use_slots, (record->have_finalize ? "true" : "false"),
|
||||||
|
Loading…
x
Reference in New Issue
Block a user