Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:57230 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 31930 invoked from network); 5 Jan 2012 08:05:08 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 5 Jan 2012 08:05:08 -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.220.170 as permitted sender) X-PHP-List-Original-Sender: laruence@gmail.com X-Host-Fingerprint: 209.85.220.170 mail-vx0-f170.google.com Received: from [209.85.220.170] ([209.85.220.170:49655] helo=mail-vx0-f170.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 8A/F5-28877-2B9550F4 for ; Thu, 05 Jan 2012 03:05:06 -0500 Received: by vcdn13 with SMTP id n13so212745vcd.29 for ; Thu, 05 Jan 2012 00:05:03 -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=+S3hDp8aBseVECZIWVrcx64jiqUtwIgLMd3Pmiyvhaw=; b=qWP1hliC4dIoWZuSbR+UKZXfl9ZpdahR0cAIshGATGFGSRk8s8ncZOhpW0gBNPlyWa 7m13OFUMQQ7/A4hz2ckbbAVl0tpeLz+oVzLWbITrNrRj2ZULOJD5cCEit8M5nAl6GPGS hQTDzCr47L5yR8Vyrpb8kbtQvj4z3ewH3IZlI= Received: by 10.52.26.199 with SMTP id n7mr506991vdg.17.1325750703254; Thu, 05 Jan 2012 00:05:03 -0800 (PST) MIME-Version: 1.0 Sender: laruence@gmail.com Received: by 10.220.3.14 with HTTP; Thu, 5 Jan 2012 00:04:42 -0800 (PST) In-Reply-To: <4F055800.9080502@lerdorf.com> 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:04:42 +0800 X-Google-Sender-Auth: OZi-d9VSKq6WGzdzzVhbLM_JtCU 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 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. thanks > > -Rasmus > --=20 Laruence =C2=A0Xinchen Hui http://www.laruence.com/