Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:57231 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 33459 invoked from network); 5 Jan 2012 08:11:30 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 5 Jan 2012 08:11:30 -0000 Authentication-Results: pb1.pair.com header.from=laruence@gmail.com; sender-id=pass Authentication-Results: pb1.pair.com smtp.mail=laruence@gmail.com; spf=pass; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmail.com designates 209.85.212.42 as permitted sender) X-PHP-List-Original-Sender: laruence@gmail.com X-Host-Fingerprint: 209.85.212.42 mail-vw0-f42.google.com Received: from [209.85.212.42] ([209.85.212.42:43177] helo=mail-vw0-f42.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 10/56-28877-03B550F4 for ; Thu, 05 Jan 2012 03:11:29 -0500 Received: by vbbfd1 with SMTP id fd1so216049vbb.29 for ; Thu, 05 Jan 2012 00:11:26 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=mime-version:sender:in-reply-to:references:from:date :x-google-sender-auth:message-id:subject:to:cc:content-type :content-transfer-encoding; bh=Sv0QN342komAPFqMmFx84akvvMmaDd7Ng9ou0FMIR+k=; b=lKrhDVwJDHwH8r/rUMlE0hb8x+P1KjzAmLqiMQ/v4yaKAi/zIL8ONFwFNk4LL7LNLj Hg2H4i6dQaOteaP3/3j1ZYgwA301fWYqCd/d8qoTvrDaahTIGcyk+4OeoPo+h5ixg5jy 8R1BnRixW3tGjN1Gq6yKbAvYs98Rr2J6kTQiM= Received: by 10.52.20.35 with SMTP id k3mr498069vde.34.1325751086231; Thu, 05 Jan 2012 00:11:26 -0800 (PST) MIME-Version: 1.0 Sender: laruence@gmail.com Received: by 10.220.3.14 with HTTP; Thu, 5 Jan 2012 00:11:05 -0800 (PST) In-Reply-To: References: <4F04A172.7080509@sugarcrm.com> <4F04AA8E.6020701@sugarcrm.com> <4F04AD6D.80608@php.net> <4F04B071.8080102@php.net> <4F04B44D.6080208@thelounge.net> <4F04BCF9.30802@lerdorf.com> <4F04BF63.5060309@lerdorf.com> <4F04C427.9050202@sugarcrm.com> <4F04C920.9050105@lerdorf.com> <4F04CB0D.6040703@lerdorf.com> <4F054CB0.6070202@sugarcrm.com> <4F05517C.5040600@lerdorf.com> <4F055238.1070605@sugarcrm.com> <4F055800.9080502@lerdorf.com> Date: Thu, 5 Jan 2012 16:11:05 +0800 X-Google-Sender-Auth: r175M_UiySgQqkFWcoPrRfAjX7Q Message-ID: To: Rasmus Lerdorf Cc: Stas Malyshev , "internals@lists.php.net" Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Subject: Re: [PHP-DEV] Re: another fix for max_input_vars. From: laruence@php.net (Laruence) On Thu, Jan 5, 2012 at 4:04 PM, Laruence wrote: > On Thu, Jan 5, 2012 at 3:57 PM, Rasmus Lerdorf wrote= : >> On 01/04/2012 11:49 PM, Laruence wrote: >>> Hi: >>> =C2=A0 there is one way =C2=A0maybe is a good try. >>> >>> =C2=A0 when resize hashtable, =C2=A0we don't just dobule the size, =C2= =A0instead, we >>> increase the hashtable size with a random delta >>> >>> =C2=A0what do you think? >> >> Sorry, you lost me. How does that help? The problem is when we collide >> on a single hash key the resulting linked list traversion gets longer >> and longer as more colliding keys are added to that hashtable. Whether >> you double the size or grow it by some other factor doesn't change this. > No, No, > > if we increase the table size with a random delta(the nTableMask will > also be random), then the collision will not be predictable. I have made a patch, plz try this mechanism, https://bugs.php.net/patch-display.php?bug_id=3D60655&patch=3Drand_hash_res= ize.patch&revision=3Dlatest I have tested , that works. and the patch is still a rough draft, so maybe some compile warnings.. thanks > > thanks > >> >> -Rasmus >> > > > > -- > Laruence =C2=A0Xinchen Hui > http://www.laruence.com/ --=20 Laruence =C2=A0Xinchen Hui http://www.laruence.com/