Date: Sun, 6 Oct 1996 01:39:29 +0400 (MSD) From: =?KOI8-R?Q?=E1=CE=C4=D2=C5=CA_=FE=C5=D2=CE=CF=D7?= (Andrey A. Chernov) <ache@nagual.ru> To: bde@zeta.org.au (Bruce Evans) Cc: bde@zeta.org.au, current@FreeBSD.org, freebsd-hackers@FreeBSD.org, joerg_wunsch@uriah.heep.sax.de Subject: Re: I plan to change random() for -current (was Re: rand() and random()) Message-ID: <199610052139.BAA06368@nagual.ru> In-Reply-To: <199610051856.EAA30329@godzilla.zeta.org.au> from "Bruce Evans" at "Oct 6, 96 04:56:27 am"
next in thread | previous in thread | raw e-mail | index | archive | help
> This is much slower than the current rand() or random(). On a P133, > measured over 10^7 calls to statically linked libraries: You forget the fact that srandom() called only _once_ (usually), so speed is unimportant here. TYPE_0 case in random() is very rare thing too, it seems nobody use it. > Perhaps make this a subroutine to avoid duplication and allow easy > changing. Division takes 10-20 times longer than a subroutine call > on Pentiums. We can't relay on Pentium times in machine-independent code. I am thinking about making it #define or inline, which one is better? -- Andrey A. Chernov <ache@nagual.ru> http://www.nagual.ru/~ache/
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199610052139.BAA06368>