Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:41845 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 15368 invoked from network); 10 Nov 2008 22:33:06 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 10 Nov 2008 22:33:06 -0000 Authentication-Results: pb1.pair.com smtp.mail=sv_forums@fmethod.com; spf=permerror; sender-id=unknown Authentication-Results: pb1.pair.com header.from=sv_forums@fmethod.com; sender-id=unknown Received-SPF: error (pb1.pair.com: domain fmethod.com from 69.16.228.148 cause and error) X-PHP-List-Original-Sender: sv_forums@fmethod.com X-Host-Fingerprint: 69.16.228.148 unknown Linux 2.4/2.6 Received: from [69.16.228.148] ([69.16.228.148:41639] helo=host.fmethod.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 4E/F2-34173-1A6B8194 for ; Mon, 10 Nov 2008 17:33:06 -0500 Received: from [83.228.56.37] (port=2592 helo=pc) by host.fmethod.com with esmtpa (Exim 4.69) (envelope-from ) id 1KzfJe-0007OU-LL for internals@lists.php.net; Mon, 10 Nov 2008 16:33:03 -0600 Message-ID: <140FB8F69197441FAB5F45A64FDA946E@pc> To: References: <7e270cea0810191211w2cb77075y5e0ad78c2f7306f7@mail.gmail.com> <243C7392-C6A0-4EE8-8AAA-34964E78D453@tekrat.com> <4022974B-4A13-4AB0-A282-973503200406@tekrat.com> <38820B1D-6D5F-4B42-9FEE-0CDF23142A57@tekrat.com> Date: Tue, 11 Nov 2008 00:32:58 +0200 MIME-Version: 1.0 Content-Type: text/plain; format=flowed; charset="iso-8859-1"; reply-type=response Content-Transfer-Encoding: 7bit X-Priority: 3 X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook Express 6.00.2900.5512 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.5579 X-AntiAbuse: This header was added to track abuse, please include it with any abuse report X-AntiAbuse: Primary Hostname - host.fmethod.com X-AntiAbuse: Original Domain - lists.php.net X-AntiAbuse: Originator/Caller UID/GID - [47 12] / [47 12] X-AntiAbuse: Sender Address Domain - fmethod.com Subject: Re: [PHP-DEV] An optimization idea From: sv_forums@fmethod.com ("Stan Vassilev | FM") > I just ran a quick benchmark on this and I'm not seeing a significant > real world change for Facebook's codebase. (definitely less than 1%) > This was a pretty small test, without a lot of code execution, so I could > see other applications doing better. I'm pretty neutral on this one, > it's not a really big change so might be worth adding if it's going to > give a few applications out there a gain, but I couldn't see doing this > everywhere of course. > > -shire Hi, Something that could give arrays a boost would be to: - pool all string literals in each file - give each stringl iteral an id (unique in the loaded environment) - bind early all array access with string literals (a common occurence), so they don't need to be resolved with a hashmap lookup, but rather, a direct stirng literal id lookup. The benefit of this approach are: - There's no need to generate a hashmap in the first place - String literal id-s are unique integers and have no conflicts, so no need to do conflict resolution. That would help with objects as well. Regards, Stan Vassilev