This is the mail archive of the cygwin mailing list for the Cygwin project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Is there a source of moderately random data with good speed in Cygwin?


On Wed, Feb 27, 2013 at 7:33 AM, Adam Dinwoodie
<Adam.Dinwoodie@metaswitch.com> wrote:
> Andrey Repin wrote:
>> I was need to pipe some bytes through application and watch it's reaction.
>> But with /dev/urandom the stream speed is only about 40Mb/sec.  Using
>> /dev/zero, however, makes it 3 orders of magnitude faster (~35Gb/s), but for
>> technical reasons, using monotonous sequence is highly undesirable.  Is there
>> any more performant source of non-monotonous byte sequences available to
>> Cygwin? I would be pretty happy even with sequential bytes, I think. Only two
>> reservations are good performance (something around 100 Mb/sec or more would
>> suffice) and a degree of randomness.
>
You could also copy one of the simple random number generators from
http://en.wikipedia.org/wiki/Linear_congruential_generator.  For
example, a simple one is

x(n+1) = (1664525 * x(n) +  1013904223) mod 2^32

Alan Thompson

--
Problem reports:       http://cygwin.com/problems.html
FAQ:                   http://cygwin.com/faq/
Documentation:         http://cygwin.com/docs.html
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]