Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:51177 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 27959 invoked from network); 31 Dec 2010 22:19:18 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 31 Dec 2010 22:19:18 -0000 Authentication-Results: pb1.pair.com header.from=smalyshev@sugarcrm.com; sender-id=pass Authentication-Results: pb1.pair.com smtp.mail=smalyshev@sugarcrm.com; spf=pass; sender-id=pass Received-SPF: pass (pb1.pair.com: domain sugarcrm.com designates 207.97.245.203 as permitted sender) X-PHP-List-Original-Sender: smalyshev@sugarcrm.com X-Host-Fingerprint: 207.97.245.203 smtp203.iad.emailsrvr.com Linux 2.6 Received: from [207.97.245.203] ([207.97.245.203:45248] helo=smtp203.iad.emailsrvr.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 54/82-10838-5E65E1D4 for ; Fri, 31 Dec 2010 17:19:18 -0500 Received: from localhost (localhost.localdomain [127.0.0.1]) by smtp40.relay.iad1a.emailsrvr.com (SMTP Server) with ESMTP id 25ADF3501DE; Fri, 31 Dec 2010 17:19:15 -0500 (EST) X-Virus-Scanned: OK Received: by smtp40.relay.iad1a.emailsrvr.com (Authenticated sender: smalyshev-AT-sugarcrm.com) with ESMTPSA id 903BE350135; Fri, 31 Dec 2010 17:19:14 -0500 (EST) Message-ID: <4D1E56E1.5090208@sugarcrm.com> Date: Fri, 31 Dec 2010 14:19:13 -0800 Organization: SugarCRM User-Agent: Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10.6; en-US; rv:1.9.2.13) Gecko/20101207 Thunderbird/3.1.7 MIME-Version: 1.0 To: Marcin Babij CC: "internals@lists.php.net" References: In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Subject: Re: [PHP-DEV] Re: Zend engine's hashtable performance tweaks From: smalyshev@sugarcrm.com (Stas Malyshev) Hi! > Sorry for no attachments in previous message, I think my attachments > weren't redirected with message by lists.php.net email confirmation > system. I send them again, and for sure I attach links to public copy of > them over HTTP: > https://gist.github.com/761094 - php-5.3.4-hashtable-optimization.patch > https://gist.github.com/761096 - apc-3.1.6-hashtable-optimization.patch I just took a quick look, so some preliminary notes: 1. +#define ZEND_HASH_SMALL_LOAD_FACTOR_INV 1.75 etc. - maybe makes sense to convert them from floats to couple of integers? I'm not sure if gcc is smart enough not to use floating point here, which would probably be slower than int *7/4. 2. Would it be possible to clean up the patch? There are tons of diffs like this: - HASH_UNPROTECT_RECURSION(ht1); - HASH_UNPROTECT_RECURSION(ht2); + HASH_UNPROTECT_RECURSION(ht1); + HASH_UNPROTECT_RECURSION(ht2); which make no sense and just make it harder to understand what's going on. 3. - ulong h; /* Used for numeric indexing */ + ulong h; why? 4. zend_inline_hash_func - could you describe why you changed it? In any case, it needs some comments, if you deleted the old one, please add description of the new one any why it is better. Will follow up after reading the patch more in depth. -- Stanislav Malyshev, Software Architect SugarCRM: http://www.sugarcrm.com/ (408)454-6900 ext. 227