delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2013/02/27/12:04:20

X-Recipient: archive-cygwin AT delorie DOT com
X-SWARE-Spam-Status: No, hits=-4.0 required=5.0 tests=AWL,BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,FREEMAIL_ENVFROM_END_DIGIT,FREEMAIL_FROM,KHOP_RCVD_TRUST,KHOP_THREADED,RCVD_IN_DNSWL_LOW,RCVD_IN_HOSTKARMA_YE
X-Spam-Check-By: sourceware.org
MIME-Version: 1.0
X-Received: by 10.180.75.110 with SMTP id b14mr27837980wiw.21.1361984624011; Wed, 27 Feb 2013 09:03:44 -0800 (PST)
In-Reply-To: <CE9C056E12502146A72FD81290379E9A60928138@ENFIRHMBX1.datcon.co.uk>
References: <1212475491 DOT 20130227184011 AT mtu-net DOT ru> <CE9C056E12502146A72FD81290379E9A60928138 AT ENFIRHMBX1 DOT datcon DOT co DOT uk>
Date: Wed, 27 Feb 2013 09:03:43 -0800
Message-ID: <CAN4-eHJu2zx08V76FvF8vF5LMuN3RbhFb5tR+ePswdJQWcwQTw@mail.gmail.com>
Subject: Re: Is there a source of moderately random data with good speed in Cygwin?
From: Alan Thompson <thompson2526 AT gmail DOT com>
To: cygwin AT cygwin DOT com
X-IsSubscribed: yes
Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm
List-Id: <cygwin.cygwin.com>
List-Unsubscribe: <mailto:cygwin-unsubscribe-archive-cygwin=delorie DOT com AT cygwin DOT com>
List-Subscribe: <mailto:cygwin-subscribe AT cygwin DOT com>
List-Archive: <http://sourceware.org/ml/cygwin/>
List-Post: <mailto:cygwin AT cygwin DOT com>
List-Help: <mailto:cygwin-help AT cygwin DOT com>, <http://sourceware.org/ml/#faqs>
Sender: cygwin-owner AT cygwin DOT com
Mail-Followup-To: cygwin AT cygwin DOT com
Delivered-To: mailing list cygwin AT cygwin DOT com

On Wed, Feb 27, 2013 at 7:33 AM, Adam Dinwoodie
<Adam DOT Dinwoodie AT metaswitch DOT 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

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019