>Search took -125.376129 secondsI double checked with a handheld stopwatch, and at no point did the hands spin backwards. Known problem?
richard@lemurconsulting.com
2006-Aug-07 08:50 UTC
[Xapian-discuss] Omega is fast, but not THAT fast
On Sun, Aug 06, 2006 at 10:45:09PM -0700, Jeff Breidenbach wrote:> >Search took -125.376129 seconds > > I double checked with a handheld stopwatch, and at no > point did the hands spin backwards. > > Known problem?Not one I have seen. Do you have a reproducible test case? -- Richard
On Mon, Aug 07, 2006 at 08:49:56AM +0100, richard@lemurconsulting.com wrote:> > >Search took -125.376129 seconds > > > > I double checked with a handheld stopwatch, and at no > > point did the hands spin backwards. > > > > Known problem? > > Not one I have seen. Do you have a reproducible test case?Also, can you say whether the following are set or unset in config.h: HAVE_GETTIMEOFDAY FTIME_RETURNS_VOID HAVE_FTIME It looks to me like the code is wrong if all three are unset. James -- /--------------------------------------------------------------------------\ James Aylett xapian.org james@tartarus.org uncertaintydivision.org
On 8/6/06, Jeff Breidenbach <breidenbach@gmail.com> wrote:> >Search took -125.376129 seconds > > I double checked with a handheld stopwatch, and at no > point did the hands spin backwards. > > Known problem?Here's the code that sets that up in 0.9.6. It's in query.cc. It depends on what platform you're running the code on. Probably you have gettimeofday() I'm guessing... #ifdef HAVE_GETTIMEOFDAY if (gettimeofday(&tv, 0) == 0) { sec = tv.tv_sec - sec; usec = tv.tv_usec - usec; if (usec < 0) { --sec; usec += 1000000; } } else { usec = -1; } #elif defined(FTIME_RETURNS_VOID) struct timeb tp; ftime(&tp); sec = tp.time - sec; usec = tp.millitm * 1000 - usec; if (usec < 0) { --sec; usec += 1000000; } #elif defined(HAVE_FTIME) struct timeb tp; if (ftime(&tp) == 0) { sec = tp.time - sec; usec = tp.millitm * 1000 - usec; if (usec < 0) { --sec; usec += 1000000; } } else { usec = -1; } #else usec = time(NULL); if (usec != -1) { sec = sec - usec; usec = 0; } #endif It actually sets sec and usec earlier but the code is similar. By coincidence I've been looking into some issues with system time going backwards recently. Is there anyway you could run this for 30 seconds: "while true ; do date ; done | uniq -c". Probably your system clock is fine but I'm paranoid right now. regards, dan carpenter