[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH] change output of htags --statistics
From: |
Hideki IWAMOTO |
Subject: |
Re: [PATCH] change output of htags --statistics |
Date: |
Wed, 04 Nov 2009 01:35:13 +0900 |
Hi.
> #elif HAVE_TIMES
I don't know whether support of times(2) is needed.
Is there anybody who is using the system that supports times
and doesn't support gettimeofday and getrusage?
On Mon, 02 Nov 2009 10:53:35 +0900, Hideki IWAMOTO wrote...
> Hi.
>
> Currently, `htags --statistics' outputs elapsed times with the accuracy of
> second.
> It is preferable that the CPU time is output and the elapsed time is output
> by higher accuracy.
>
> This patch changes `htags --statistics' as follows.
>
> #if HAVE_GETRUSAGE && HAVE_GETTIMEOFDAY
> Use gettimeofday() to get elapsed time.
> Use getrusage() to get CPU time.
> #elif HAVE_TIMES
> #if HAVE_GETTIMEOFDAY
> Use gettimeofday() to get elapsed time.
> Use times() to get CPU time.
> #else
> Use times() to get elapsed time and CPU time.
> #endif
> #else
> #if HAVE_GETTIMEOFDAY
> Use gettimeofday() to get elapsed time.
> #else
> Use time() to get elapsed time.
> #endif
> #endif
>
>
> The output in each case is as follows.
>
> ======== Case 1 =============================================================
> #define HAVE_GETRUSAGE 1
> #define HAVE_GETTIMEOFDAY 1
>
> $ htags --statistics
> period user[sec] system[sec] elapsed[sec] %CPU
> --------------------------------- --------- ----------- ------------ -----
> Time of making duplicate entries 1.988 0.184 1.420 153.0
> Time of making function index 0.272 0.036 0.281 109.7
> Time of making file index 0.028 0.012 0.042 96.3
> Time of making include file index 1.120 0.092 1.216 99.7
> Time of making hypertext 18.701 1.888 15.474 133.1
> The entire time 22.113 2.220 18.440 132.0
>
> ======== Case 2 =============================================================
> #undef HAVE_GETRUSAGE
> #define HAVE_GETTIMEOFDAY 1
> #define HAVE_TIMES 1
>
> $ htags --statistics
> period user[sec] system[sec] elapsed[sec] %CPU
> --------------------------------- --------- ----------- ------------ -----
> Time of making duplicate entries 1.970 0.170 1.527 140.1
> Time of making function index 0.290 0.020 0.278 111.6
> Time of making file index 0.030 0.010 0.041 97.8
> Time of making include file index 1.110 0.080 1.201 99.1
> Time of making hypertext 18.060 1.980 15.221 131.7
> The entire time 21.460 2.260 18.276 129.8
>
> ======== Case 3 =============================================================
> #undef HAVE_GETRUSAGE
> #undef HAVE_GETTIMEOFDAY
> #define HAVE_TIMES 1
>
> $ htags --statistics
> period user[sec] system[sec] elapsed[sec] %CPU
> --------------------------------- --------- ----------- ------------ -----
> Time of making duplicate entries 2.020 0.190 1.550 142.6
> Time of making function index 0.260 0.040 0.280 107.1
> Time of making file index 0.020 0.030 0.040 125.0
> Time of making include file index 1.070 0.110 1.170 100.9
> Time of making hypertext 18.580 2.190 15.310 135.7
> The entire time 21.950 2.560 18.360 133.5
>
> ======== Case 4 =============================================================
> #undef HAVE_GETRUSAGE
> #define HAVE_GETTIMEOFDAY 1
> #undef HAVE_TIMES
>
> $ htags --statistics
> period elapsed[sec]
> --------------------------------- ------------
> Time of making duplicate entries 1.405
> Time of making function index 0.294
> Time of making file index 0.042
> Time of making include file index 1.157
> Time of making hypertext 15.555
> The entire time 18.461
>
> ======== Case 5 =============================================================
> #undef HAVE_GETRUSAGE
> #undef HAVE_GETTIMEOFDAY
> #undef HAVE_TIMES
>
> $ htags --statistics
> period elapsed[sec]
> --------------------------------- ------------
> Time of making duplicate entries 2.000
> Time of making function index 0.000
> Time of making file index 0.000
> Time of making include file index 1.000
> Time of making hypertext 15.000
> The entire time 18.000
>
>
> Diffstat:
> configure.ac | 2
> htags/htags.c | 50 +----
> libutil/Makefile.am | 4
> libutil/global.h | 1
> libutil/statistics.c | 493
> +++++++++++++++++++++++++++++++++++++++++++++++++++
> libutil/statistics.h | 84 ++++++++
> libutil/strbuf.c | 15 +
> libutil/strbuf.h | 4
> 8 files changed, 616 insertions(+), 37 deletions(-)
>
> ----
> Hideki IWAMOTO address@hidden
> ______________________________________________________________________
>
> _______________________________________________
> Bug-global mailing list
> address@hidden
> http://lists.gnu.org/mailman/listinfo/bug-global
----
Hideki IWAMOTO address@hidden