t.lock2 issues

Matthias Andree matthias.andree at gmx.de
Sat Feb 1 13:59:36 CET 2003


On Fri, 31 Jan 2003, David Relson wrote:

> test 1 - with the suggested fix.  5 runs of 29 seconds each (no variation).
> test 2 - code without any fix     5 runs of 27 seconds each (no variation)
> test 3 - with fix and using time() as seed - 5 runs of 29, 27, 28, 27, 27 
> seconds
>           (timer resolution - 1 sec)
> test 4 - with fix and gettimeofday() as seed - 5 runs of 22, 23, 24, 22, 22 
> seconds
>           (used tv_usec - microseconds)
> 
> It seems that using microseconds to seed the random number generator gives 
> the lowest run time, which also raises the likelihood of lock 
> contention.  This is a good thing as the goal of t.lock2 is to test 
> database locking.
> 
> However, as this seems non-critical and we're close to having a stable 
> release of bogofilter, any changes in this area can wait until after the 
> release.

OTOH, the changes aren't dangerous, so let's use the patch, seed the
stuff with the microseconds as you suggest and change the suggested
cast to (float) to (double) because we use double all over the place and
we don't want to sacrifice precision (in terms of the mantissa) -- float
has 23 bits usually (losing 11 bits), double has 52 bits.




More information about the bogofilter-dev mailing list