From: PauliePorsche on
Alright, thank you John!
From: Walter Roberson on
John D'Errico wrote:
> PauliePorsche <Bhopale73(a)gmail.com> wrote in message
> <1653919816.96521.1281574388921.JavaMail.root(a)gallium.mathforum.org>...
>> I have to run lengthy simulations which involves generating numbers
>> randomly literally millions of times. I ended up running this
>> simulation, figured out I'll need to tweak some algos, and re-run the
>> simulation
>>
>> My question is it quicker to import a text file (from the previous
>> simulation) and use the random numbers from that than it is to use the
>> random no# simulator?
>
> Reading a text file is very slow in comparison to any
> simple ops like generation of random numbers.

On the other hand, it might plausibly be efficient to read in a binary
file with the data. Although reading from disk is relatively slow,
generally the more you read at one time the more efficient it gets (the
fixed overheads get distributed over more data), and possibly "millions"
of random numbers is enough to make it worth while.