[Eventmachine-talk] Ruby I/O

Francis Cianfrocca
Tue, 13 Mar 2007 08:52:56 -0000

On 3/13/07, Francis Cianfrocca <garbagecat10 at gmail.com>
wrote:
>
> On 3/13/07, Thomas Ptacek <tqbf at matasano.com> wrote:
> >
> >  The gettimeofday stuff is a problem. Every high-speed project
I''ve
> > worked on has replaced gettimeofday; it''s a drag on
performance. I''m
> > pretty sure the "correct" answer now is to calibrate and use
rdtsc,
> > the cycle counter, which is essentially free (costs about as much as a
> > non-cached DRAM access). If you calibrate, you can convert from TSC
> > cycles to a struct timeval to hand select().
>
>
>
> gettimeofday is there in the Unix versions to support programmable timers.
> The implementation originally used time but I changed it when the need for
> subsecond resolution came up. There is probably a range of approaches to
> dealing with this. At least we could detect when subsecond timers are in
use
> (the exception rather than the rule) and behave differently.
>
>

Well, on Linux, time() seems just about as costly as gettimeofday.
-------------- next part --------------
An HTML attachment was scrubbed...