]> granicus.if.org Git - gc/commit
Add basic calculation of the total full-collection time
authorPaul Bone <paul@bone.id.au>
Fri, 10 Nov 2017 07:12:57 +0000 (10:12 +0300)
committerIvan Maidanski <ivmai@mail.ru>
Fri, 10 Nov 2017 07:19:04 +0000 (10:19 +0300)
commitd0f71f1df918e59b6f58ba6a4d91f09a75022a57
tree973f6e50c26f82dc355fd83a2d1087e28ecff50e
parent0f5a88d53ba02137b72a6fccfdaeaadd1f908d2f
Add basic calculation of the total full-collection time

Issue #139 (bdwgc).

New API functions: GC_start_performance_measurement,
GC_get_full_gc_total_time.

This patch is based on code originally written by Zoltan Somogyi
on 2008-03-18.

* alloc.c [!NO_CLOCK] (full_gc_total_time, measure_performance): New
static variable definition; add comment.
* alloc.c [!NO_CLOCK] (GC_start_performance_measurement,
GC_get_full_gc_total_time): New API function definition.
* alloc.c [!NO_CLOCK] (GC_try_to_collect_inner): Declare
start_time_valid local variable; set start_time_valid to true if
GET_TIME(start_time) is called; call GET_TIME(start_time) also if
measure_performance; declare time_diff local variable (used to store
the result of MS_TIME_DIFF());  GET_TIME(current_time) is called only
if start_time_valid; update full_gc_total_time if measure_performance.
* include/gc.h (GC_start_performance_measurement,
GC_get_full_gc_total_time): New API function declaration.
* tests/test.c (INIT_PERF_MEASUREMENT): New macro.
* tests/test.c (GC_COND_INIT): Call INIT_PERF_MEASUREMENT.
* tests/test.c [!NO_CLOCK] (check_heap_stats): Call
GC_get_full_gc_total_time() and print the total time of full
collections.
alloc.c
include/gc.h
tests/test.c