Re: Would timevar be accepted in gnulib?

2018-09-30 Thread Akim Demaille
Hi Bruno! > Le 29 sept. 2018 à 19:54, Bruno Haible a écrit : > > Hi Akim, > >> Here is my initial proposal for timevar in gnulib. > > Thanks! The code looks well-commented now. > > I pushed it for you, Thanks! > after completing the ChangeLog entry. 8-)=) Sorry, I completely forgot that…

Re: Would timevar be accepted in gnulib?

2018-09-29 Thread Bruno Haible
Hi Akim, > Here is my initial proposal for timevar in gnulib. Thanks! The code looks well-commented now. I pushed it for you, after completing the ChangeLog entry. Bruno

Re: Would timevar be accepted in gnulib?

2018-09-27 Thread Akim Demaille
Hi! Here is my initial proposal for timevar in gnulib. Cheers! commit 2e50fd35c46f6ffa1079f6939223cd36ba2fb71a Author: Akim Demaille Date: Thu Sep 27 07:00:42 2018 +0200 timevar: import from Bison * m4/timevar.m4, modules/timevar, lib/timevar.h, lib/timevar.c, *

Re: Would timevar be accepted in gnulib?

2018-09-24 Thread Bruno Haible
Hi Akim, > > Two other points worth documenting: > > * When the program invokes subprocesses, which of the times (usr, sys, > >wall) include the times of the subprocess, and with which multiplicity? > > I don’t know what you name multiplicity :/ Multiplicity is probably a wrong term. What

Re: Would timevar be accepted in gnulib?

2018-09-24 Thread Akim Demaille
Hey Bruno! > Le 23 sept. 2018 à 23:46, Bruno Haible a écrit : > > Hi Akim, > >>> But what about the list-of-lists use-case? ... >> ... >> DEFTIMEVAR (TV_FOO, "Foo phase") >> DEFTIMEVAR (TV_FOO_BAR, "Foo: Bar phase") >> DEFTIMEVAR (TV_FOO_BAZ, "Foo: Baz phase") > > Looks fine to me. So the

Re: Would timevar be accepted in gnulib?

2018-09-23 Thread Bruno Haible
Hi Akim, > > But what about the list-of-lists use-case? ... > ... > DEFTIMEVAR (TV_FOO, "Foo phase") > DEFTIMEVAR (TV_FOO_BAR, "Foo: Bar phase") > DEFTIMEVAR (TV_FOO_BAZ, "Foo: Baz phase") Looks fine to me. So the approach (a) works fine with lists-of-lists; it only needs to be documented.

Re: Would timevar be accepted in gnulib?

2018-09-23 Thread Akim Demaille
Hi! > Le 23 sept. 2018 à 15:08, Bruno Haible a écrit : > > Hi Akim, > >>> What do you think? Do you think the list-of-lists use-case makes sense? >>> Do you think configuring the list at run time is something people may want >>> to do? >> >> You have a strong point here. But I don’t know if

Re: Would timevar be accepted in gnulib?

2018-09-23 Thread Bruno Haible
Hi Akim, > > What do you think? Do you think the list-of-lists use-case makes sense? > > Do you think configuring the list at run time is something people may want > > to do? > > You have a strong point here. But I don’t know if there would > be actual users for such dynamic timers. OK, no

Re: Would timevar be accepted in gnulib?

2018-09-23 Thread Akim Demaille
Hi Bruno! > Le 23 sept. 2018 à 11:42, Bruno Haible a écrit : > > Hi Akim, > >> I’m not sure I understand what you mean here. The timers are >> used in many places in the code, not just main(). We need some >> global definition somewhere, and we want to iterate over them >> when displaying

Re: Would timevar be accepted in gnulib?

2018-09-23 Thread Bruno Haible
Addendum: > Note that (c), like (a), has the benefit that adding a new timevar is a > modification in a single place. This is true only if all uses of the timevars are in a single C compilation unit (e.g. the top-level). If the user wants to use them in different source files, it requires 2

Re: Would timevar be accepted in gnulib?

2018-09-23 Thread Bruno Haible
Hi Akim, > > 1) Simplify. I don't see the point of the DEFTIMEVAR layer with the enum. > > Couldn't the code just do > > timevar_t tv_total; > > timevar_t tv_reader; > > .. > > and > > init_timevar (); > > timevar_start (_total); > > > > timevar_push (_reader); > >

Re: Would timevar be accepted in gnulib?

2018-09-22 Thread Akim Demaille
Hi all, Thanks for the answers! > Le 21 sept. 2018 à 14:04, Bruno Haible a écrit : > > Hi Akim, > >> Would there be some interest for this in gnulib? > > There is well a place for modules like this one in gnulib. See >

Re: Would timevar be accepted in gnulib?

2018-09-21 Thread Sergey Poznyakoff
Paul Eggert ha escrit: > It might be helpful to have it, though I don't offhand know of > programs other than Bison and GCC that use that sort of thing. GNU dico is another one (although it uses its own implementation). Regards, Sergey

Re: Would timevar be accepted in gnulib?

2018-09-21 Thread Bruno Haible
Hi Akim, > Would there be some interest for this in gnulib? There is well a place for modules like this one in gnulib. See https://www.gnu.org/software/gnulib/manual/html_node/Portability-and-Application-Code.html > allow self-profiling. It does not aim at replacing real profiling > tools, but

Re: Would timevar be accepted in gnulib?

2018-09-21 Thread Paul Eggert
It might be helpful to have it, though I don't offhand know of programs other than Bison and GCC that use that sort of thing. (Emacs has something in Emacs Lisp instead.) The hard part, to my mind, would be the documentation.

Would timevar be accepted in gnulib?

2018-09-20 Thread Akim Demaille
Hi! Bison has adopted, many years ago, timevars, a set of tools that allow self-profiling. It does not aim at replacing real profiling tools, but rather to report in a concise way the cost of various phases in a program. For instance with Bison: Execution times (seconds) LALR(1)