Path: utzoo!attcan!uunet!convex!convex.COM From: patrick@convex.COM (Patrick F. McGehearty) Newsgroups: comp.lang.fortran Subject: Re: Random Number Functions--Generate versus Input Message-ID: <108430@convex.convex.com> Date: 8 Nov 90 20:28:56 GMT References: <1990Nov8.170334.24579@athena.mit.edu> Sender: usenet@convex.com Reply-To: patrick@convex.COM (Patrick F. McGehearty) Organization: Convex Computer Corporation, Richardson, Tx. Lines: 13 In article <1990Nov8.170334.24579@athena.mit.edu> oliver@athena.mit.edu (James D. Oliver III) writes: >I have a number (order of magnitude 10**6) of random number function values >to generate ... > My question is, is it faster in general to regenerate the random function > values every time (this part of the code can't be vectorized), or to just > read the values in from a file? It depends on how you read the numbers. Using unformatted, direct I/O with large buffers into an array can be quite efficient. Reading each number with a separate READ from an ascii file (thus requiring a string to real conversion) will be quite slow. Whether the unformatted read is as fast as a random number function is implementation dependent and should be easy to benchmark.