From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Paul Eggert Newsgroups: gmane.emacs.devel Subject: Re: random doesn't feel very random Date: Tue, 04 Sep 2012 13:07:41 -0700 Organization: UCLA Computer Science Department Message-ID: <50465F8D.2030706@cs.ucla.edu> References: <876288yh72.fsf@kanis.fr> <87wr0livd4.fsf@Rainer.invalid> <83k3wfqtyx.fsf@gnu.org> <83vcfzosri.fsf@gnu.org> <5041626B.6080608@cs.ucla.edu> <87harirz13.fsf@Rainer.invalid> <50420B53.4030006@cs.ucla.edu> <87392xmw9a.fsf@spindle.srvr.nix> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Trace: ger.gmane.org 1346789276 3871 80.91.229.3 (4 Sep 2012 20:07:56 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Tue, 4 Sep 2012 20:07:56 +0000 (UTC) Cc: Achim Gratz , emacs-devel@gnu.org To: Nix Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Tue Sep 04 22:07:56 2012 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1T8zPf-0004kI-Dg for ged-emacs-devel@m.gmane.org; Tue, 04 Sep 2012 22:07:55 +0200 Original-Received: from localhost ([::1]:43697 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1T8zPc-00070W-Fn for ged-emacs-devel@m.gmane.org; Tue, 04 Sep 2012 16:07:52 -0400 Original-Received: from eggs.gnu.org ([208.118.235.92]:34389) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1T8zPZ-0006zf-1M for emacs-devel@gnu.org; Tue, 04 Sep 2012 16:07:50 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1T8zPX-0004wj-V6 for emacs-devel@gnu.org; Tue, 04 Sep 2012 16:07:48 -0400 Original-Received: from smtp.cs.ucla.edu ([131.179.128.62]:41406) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1T8zPX-0004uh-N8 for emacs-devel@gnu.org; Tue, 04 Sep 2012 16:07:47 -0400 Original-Received: from localhost (localhost.localdomain [127.0.0.1]) by smtp.cs.ucla.edu (Postfix) with ESMTP id 96E04A6002D; Tue, 4 Sep 2012 13:07:40 -0700 (PDT) X-Virus-Scanned: amavisd-new at smtp.cs.ucla.edu Original-Received: from smtp.cs.ucla.edu ([127.0.0.1]) by localhost (smtp.cs.ucla.edu [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id QB3TyzIM3n1K; Tue, 4 Sep 2012 13:07:40 -0700 (PDT) Original-Received: from [192.168.1.3] (pool-108-23-119-2.lsanca.fios.verizon.net [108.23.119.2]) by smtp.cs.ucla.edu (Postfix) with ESMTPSA id 2E20CA6002C; Tue, 4 Sep 2012 13:07:40 -0700 (PDT) User-Agent: Mozilla/5.0 (X11; Linux i686; rv:15.0) Gecko/20120827 Thunderbird/15.0 In-Reply-To: <87392xmw9a.fsf@spindle.srvr.nix> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 3) X-Received-From: 131.179.128.62 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:153017 Archived-At: On 09/04/2012 12:19 PM, Nix wrote: > I'd recommend using /dev/urandom unconditionally, > certainly for rare seeding operations Yes, gnulib will have a module to do that, and that's good enough for rare operations, but it's not enough in general. Applications like 'shred' need lots of random data and /dev/urandom is too slow for that. For example, on my platform (AMD Phenom II X4 910e, x86-64, Fedora 17, coreutils 8.19): $ time dd if=/dev/urandom of=/dev/null ibs=12k obs=12k count=100000 100000+0 records in 100000+0 records out 1228800000 bytes (1.2 GB) copied, 92.9543 s, 13.2 MB/s real 1m32.957s user 0m0.100s sys 1m32.563s $ time shred --size=1200000k --iterations=1 /dev/null real 0m0.670s user 0m0.491s sys 0m0.072s Both applications wrote the same amount of random data to /dev/null, using the same 12k blocksize. Originally, 'shred' used /dev/urandom, but users (rightly) complained that it was a pig, so we went with something faster -- in this example, over 100x faster.