Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 5 Feb 2002 15:15:40 -0800
From:      Alfred Perlstein <bright@mu.org>
To:        "Andrey A. Chernov" <ache@nagual.pp.ru>
Cc:        Mark Murray <mark@grondar.za>, des@freebsd.org, cvs-committers@freebsd.org, cvs-all@freebsd.org
Subject:   Re: cvs commit: src/lib/libpam/modules/pam_unix pam_unix.c
Message-ID:  <20020205151540.Z59017@elvis.mu.org>
In-Reply-To: <20020205231051.GA9710@nagual.pp.ru>; from ache@nagual.pp.ru on Wed, Feb 06, 2002 at 02:10:51AM %2B0300
References:  <20020205215540.GB8579@nagual.pp.ru> <200202052220.g15MKps32595@greenpeace.grondar.org> <20020205231051.GA9710@nagual.pp.ru>

next in thread | previous in thread | raw e-mail | index | archive | help
* Andrey A. Chernov <ache@nagual.pp.ru> [020205 15:11] wrote:
> On Tue, Feb 05, 2002 at 22:20:46 +0000, Mark Murray wrote:
> > > 2) Have the same speed compared to random() (or even faster)
> > 
> > It is three times slower, according to a cheap benchmark.
> 
> Yes, 3-4 times slower, according to my new test I write more accurately.
> 
> But for non-looped 7 or 14 pam_unix() random() calls it gains _nothing_,
> they are very fast comparing to even minimal _net_ delay for YP code they
> needed.
> 
> BTW, to clarify my position: I not insist on using arc4random(), I insist 
> on removing random(). You can replace arc4random() with any fastest code 
> you wants.

to address the speed issue you could implement internal functions to
save and restore the random() state.  (as I've already suggested)

-- 
-Alfred Perlstein [alfred@freebsd.org]
'Instead of asking why a piece of software is using "1970s technology,"
 start asking why software is ignoring 30 years of accumulated wisdom.'
Tax deductable donations for FreeBSD: http://www.freebsdfoundation.org/

To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe cvs-all" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20020205151540.Z59017>