[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [MiNT] MiNTlib timing related functions behavior/performance



Hi,

On keskiviikko 17 huhtikuu 2013, Helmut Karlowski wrote:
> Eero Tamminen, 17.04.2013 19:21:42:
> > As localtime.o is lacking symbols, I have manually added time_fun_??
> > function symbols to places I saw in program disassembly to be function
> > entry points within it.  *_AA is the first address, *_HH is the last
> > one (also in localtime.c source code, I assume).
> 
> According to the graph it's not getenv that consumes much time.

Naturally, as getenv() is just a lookup to environment which
in a TOS program is really small.


One should note though that if there aren't symbols for
all the symbols, profiler output can be slightly misleading
(for non-subroutine nodes in the graph) because it assigns
cost to whatever symbol preceeds them.

Subroutine costs (in diamond shaped nodes) are accurate
though, but with symbols missing for subroutines it itself
calls, you don't know how the costs are split / where they go.


> But in mintlib is:
> 
> localtime(timep)
> const time_t * const  timep;
> {
>    tzset();
>    return localsub(timep, 0L, &tm);
> }
> 
> 
> void
> tzset(void)
> {
>    register const char * name;
> 
>    name = getenv("TZ");
>    if (name == NULL) {
>      tzsetwall();
>      return;
>    }
> ...
> 
> So every call to localtime calls getenv. That's what I meant. Maybe you
> could test mintlib with the tzset omitted.

I'll help anybody who wants to profile their test binaries
with Hatari.

Hatari supports now reading DRI/GST symbols from the binary
itself, so supplying the symbols is just a matter of adding
"-Wl,--traditional-format" option to linking flags.


	- Eero