Re: [RFC 0/2] ABI for clock_gettime_ns
From: Andy Lutomirski
Date: Sat Dec 24 2011 - 23:07:05 EST
On Fri, Dec 23, 2011 at 10:50 PM, Richard Cochran
<richardcochran@xxxxxxxxx> wrote:
> On Fri, Dec 23, 2011 at 09:59:04PM -0800, Andy Lutomirski wrote:
>
>> I've written the patch and it's not as big an improvement as I hoped.
>> I'll play with it a bit and send it out soon.
>
> Andy, can you say what the motivation or use case is?
Simplicity and performance. Many users (e.g. I) use clock_gettime to
measure elapsed time. We just end up converting to flat nanoseconds
over and over. This syscall avoids the conversion.
The added padding bits will allow UTC/TAI offset and/or sub-nanosecond
precision in the future if someone wants to add them.
I seem to be saving just over one nanosecond per call on my laptop,
which isn't that impressive. The real-world improvement may be better
-- calling clock_gettime in a tight loop should give very good branch
prediction success, which will make the cost of the loops that flat ns
avoids seem a little lower than they are.
I'll send patches in the morning.
--Andy
>
> Just curious,
>
> Richard
--
Andy Lutomirski
AMA Capital Management, LLC
Office: (310) 553-5322
Mobile: (650) 906-0647
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/