Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:30617 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 51691 invoked by uid 1010); 8 Jul 2007 10:37:55 -0000 Delivered-To: ezmlm-scan-internals@lists.php.net Delivered-To: ezmlm-internals@lists.php.net Received: (qmail 51676 invoked from network); 8 Jul 2007 10:37:55 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 8 Jul 2007 10:37:55 -0000 Authentication-Results: pb1.pair.com header.from=gunther@keryx.se; sender-id=pass Authentication-Results: pb1.pair.com smtp.mail=gunther@keryx.se; spf=pass; sender-id=pass Received-SPF: pass (pb1.pair.com: domain keryx.se designates 208.69.121.33 as permitted sender) X-PHP-List-Original-Sender: gunther@keryx.se X-Host-Fingerprint: 208.69.121.33 supavet.nexcess.net Received: from [208.69.121.33] ([208.69.121.33:37613] helo=supavet.nexcess.net) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 63/55-32960-18EB0964 for ; Sun, 08 Jul 2007 06:37:53 -0400 Received: (qmail 9474 invoked by uid 108); 8 Jul 2007 10:37:50 -0000 Received: from unknown (HELO ?127.0.0.1?) (gunther@keryx.se@87.227.57.139) by supavet.nexcess.net with ESMTPA; 8 Jul 2007 10:37:50 -0000 Message-ID: <4690BE7A.4040405@keryx.se> Date: Sun, 08 Jul 2007 12:37:46 +0200 User-Agent: Thunderbird 2.0.0.4 (Windows/20070604) MIME-Version: 1.0 To: internals@lists.php.net Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Antivirus: avast! (VPS 000754-4, 2007-07-06), Outbound message X-Antivirus-Status: Clean Subject: Why not skip libc for _all_ random functions? From: gunther@keryx.se (Lars Gunther) Hi all on this list! My first post here. This is a suggestion I think would not be too hard to implement: Skip libc for all random functions. As I see it there is no reason to keep it. I can't think of any application that would break if rand() would produce better random results at a higher speed. So basically what I am saying is this: Implement the mersenne twister in the back of all random functions. 1. Make rand() an alias to mt_rand() 2. Make srand() an alias to mt_srand() 3. Make getrandmax() an alias to mt_getrandmax() 4. Have array_rand() implement MT in the back (if it is not doing so already) However, I am not a C-coder. I can not help out in this task myself, but thinks it makes sense and could be quite easy to do - for someone that do knows how to C. Lars Gunther P.S. For an introduction to who I am one might read: http://www.webstandards.org/action/edutf/interviews/gunther-en/ and look at http://www.flickr.com/photos/keryxgunther/143376264/