[Eventmachine-talk] Ruby I/O

Thomas Ptacek
Tue, 13 Mar 2007 16:42:44 -0000

The kernel crossing is the entire expense of gettimeofday. There''s no
strategy here other than a recognition that converting TSC deltas to
microseconds is error-prone and causes drift.

On 3/13/07, Francis Cianfrocca <garbagecat10 at gmail.com>
wrote:
> On 3/13/07, Thomas Ptacek <tqbf at matasano.com> wrote:
> > A SWAG, created exclusively in the service of not cluttering the list
> > with another 500 word message without writing a line of code:
> >
> > http://pastie.caboo.se/46697
> >
> > tsc_gettimeofday() from this link is thus a drop-in replacement for
> > g.t.o.d(). I haven''t profiled; I recalibrate every 20 calls
> > (calibrating the TSC is a pain). I make no claims to performance,
> > portability, or correctness.
>
>
> What''s the strategy here? You calculate an average delta value
between calls
> and re-set against the real time every twenty times? So the real timesaver
> is that you avoiding the kernel crossing?
>
>
> _______________________________________________
> Eventmachine-talk mailing list
> Eventmachine-talk at rubyforge.org
> http://rubyforge.org/mailman/listinfo/eventmachine-talk
>