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

Re: [MirageOS-devel] Timestamp representation and CLOCK

On 9 July 2015 at 15:04, David Sheets <sheets@xxxxxxxxxxxx> wrote:
> Off the top of my head I notice two things:
> 1. The int64 and tuple representations make a timestamp use 2*word +
> 12 bytes if I count correctly. That is 20 bytes on a 32-bit machine
> and 28 bytes on a 64-bit machine to represent 12 bytes of data. :-( If
> we represent a timestamp as int * int * int, we only use word + 12
> bytes, again hoping I can count. This would save some space but would
> make implementations significantly more complex. Maybe there is an
> even better representation

Any program that is storing a very large number of timestamps can
always use its own packed representation based on its own range and
precision requirements. The base representation should be fast and at
least support nanosecond precision (for eg profiling use cases), but I
think size is less important.

> 2. What about a function on every CLOCK which tells you what precision
> it can guarantee? It seems like it would be a potentially useful value
> that only the CLOCK implementer knows.

yes this is important eg see clock_gettime(), clock_getres() in posix.


MirageOS-devel mailing list



Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.