This is the mail archive of the
cygwin
mailing list for the Cygwin project.
RE: Is there a source of moderately random data with good speed in Cygwin?
- From: Adam Dinwoodie <Adam dot Dinwoodie at metaswitch dot com>
- To: "cygwin at cygwin dot com" <cygwin at cygwin dot com>
- Date: Wed, 27 Feb 2013 15:33:23 +0000
- Subject: RE: Is there a source of moderately random data with good speed in Cygwin?
- Deferred-delivery: Wed, 27 Feb 2013 15:33:00 +0000
- References: <1212475491.20130227184011@mtu-net.ru>
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 want a source of data that's non-monotonous but faster than /dev/urandom.
I don't see how this is a Cygwin issue at all, and thus I don't think it
belongs on this list.
Nonetheless, I suspect the easiest solution is to write a short C program to
produce your output, along the lines of (untested):
#include <stdio.h>
int main () {
unsigned char c;
for (c = 0;; c++)
putchar(c);
}
Alternatively, pre-cache some output and use that:
head --bytes=1G >/var/cache/randomdata
./myapp <(while :;do cat /var/cache/randomdata; done)
--
Adam Dinwoodie
Messages posted to this list are made in a personal capacity.
--
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