Current-Users archive

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

Re: CVS commit: src/lib/libc/time



Thanks for all your explanations!

kre%munnari.OZ.AU@localhost said:
>   | It does some things at runtime which could be
>   | done more efficiently. 
> [...]
> For NetBSD, where we know that time_t is
> not a floating point type and we know it is signed, not unsigned, etc,
> some of that code could be #if'd away (or just deleted).

I think that will be optimized away by the compiler.
What looks worse is the code which does the binary search
in time_t space: It will always try impossible values
and get tm_year overflows. This could be avoided if the
search space got reduced by some compile-time constants.
One could even speed-optimize the code by checking early
whether the time_t is in the most common range (eg from ~now
to now+X) and reducing the number of loop iterations
in that case...

> I could take a look if no-one else is interested, if you're not all in
> an extreme hurry for the result...

That would be great. Since you are familiar with the project
and its processes it would make most sense.
There is no reason to hurry - the current code behaves well
as long as the user input is in reasonable limits, and
there is no need to pull anything up to 5.0.

> Someone
> else would need to check it, then commit it.

I can do that.

best regards
Matthias




-------------------------------------------------------------------
-------------------------------------------------------------------
Forschungszentrum Juelich GmbH
52425 Juelich

Sitz der Gesellschaft: Juelich
Eingetragen im Handelsregister des Amtsgerichts Dueren Nr. HR B 3498
Vorsitzende des Aufsichtsrats: MinDir'in Baerbel Brumme-Bothe
Geschaeftsfuehrung: Prof. Dr. Achim Bachem (Vorsitzender),
Dr. Ulrich Krafft (stellv. Vorsitzender), Prof. Dr. Harald Bolt,
Dr. Sebastian M. Schmidt
-------------------------------------------------------------------
-------------------------------------------------------------------


Home | Main Index | Thread Index | Old Index