Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:91835 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 66617 invoked from network); 22 Mar 2016 04:16:07 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 22 Mar 2016 04:16:07 -0000 Authentication-Results: pb1.pair.com smtp.mail=cornelius.howl@gmail.com; spf=pass; sender-id=pass Authentication-Results: pb1.pair.com header.from=cornelius.howl@gmail.com; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmail.com designates 209.85.218.50 as permitted sender) X-PHP-List-Original-Sender: cornelius.howl@gmail.com X-Host-Fingerprint: 209.85.218.50 mail-oi0-f50.google.com Received: from [209.85.218.50] ([209.85.218.50:33220] helo=mail-oi0-f50.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id D8/82-46740-507C0F65 for ; Mon, 21 Mar 2016 23:16:05 -0500 Received: by mail-oi0-f50.google.com with SMTP id d205so160511209oia.0 for ; Mon, 21 Mar 2016 21:16:05 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc; bh=ZqyBhv+z9ZJ16P/4tQ7wcbEa0DTlnStXl5KGAt8MXpQ=; b=EJBhk3+3dFGQiS2OrMyngpodbYYSARGl1W4crua4kt4wcOxvKNEsalwgbetI8NUV0e GH4B7A/DqUuGtpGgsfciIogUjWdyGByDGLaSE1pTXrJGwXM32tM4rexkSFaTlEqnL7bV NFoXIiv2j5DciajhB0FJ7c+SvRs34heAPFVgt3kP7ggKW41lChumEuhMfyJAWnKWQeU6 DvW9S60o9oNE3jtQO5GtDY3Gcw3Kgr1CRTrodDf+2phrsoSANeuBg4PGe/LjfZe0Bn4L kJBR7l9Y9BTpcFKtQIcYtsDqMq+NLjaUKzJDSWWHxY6i/S58BiWCnkISowjl8NwW4KWb Nhvw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:date :message-id:subject:from:to:cc; bh=ZqyBhv+z9ZJ16P/4tQ7wcbEa0DTlnStXl5KGAt8MXpQ=; b=O2Y2PDRdDn5BDh9V5uzW2EyGzB1b7jCg9xW+Cu85+jY7jDwNwt91EtuQPT33fXPZVA QnJbDhD1sVbZCwDDdzXy3zYX3eXfLo084cquo6udZWkNKXSiIQSF6hvPaJVqdRsagc7o fro4+wVtXeem2AoATI2JJRsH7GBaBvI3cG9K9kuJHGRscDuOjutyN8LS0dm0ekns96co Z5xPNEVwU5xLjqT6ujaHnYujbZv3n5ZWHt8ZKJffAosiCJn1cruxf7SIBiizOcmuwvBU M5EZGOC/1xIdx+qvshPxT/nRovntsK3e4f2Ia0nHK7CUN/jDlxh3BerHbzKrXr7e2xto HApA== X-Gm-Message-State: AD7BkJJXy5Z2QrqVh9fZQU/bVLv4vUt/arvP81nELaVnOgKQC7uOah2kt1uu6JFucm8RGpn+LMV5oAHRQyZeNQ== MIME-Version: 1.0 X-Received: by 10.157.19.54 with SMTP id f51mr1800865ote.127.1458620162179; Mon, 21 Mar 2016 21:16:02 -0700 (PDT) Received: by 10.157.7.167 with HTTP; Mon, 21 Mar 2016 21:16:02 -0700 (PDT) In-Reply-To: References: <44.0B.03097.E29BDE65@pb1.pair.com> Date: Tue, 22 Mar 2016 13:16:02 +0900 Message-ID: To: Nikita Nefedov Cc: "internals@lists.php.net" Content-Type: multipart/alternative; boundary=001a1141ca60a12bea052e9b78a2 Subject: Re: Object getter method optimization From: cornelius.howl@gmail.com (Lin Yo-An) --001a1141ca60a12bea052e9b78a2 Content-Type: text/plain; charset=UTF-8 > > >> I was playing with this idea sometime ago, it gives good performance > boost for code like `for ($i = 0; $i < 100000; $i++) $a->getFoo();` but in > the end of the day it's a very limited optimization. > If you abstract away from getters and say you want to optimize more and > more small functions like this one, you end up realizing that what you're > actually doing is what JIT compilation would do in a more generic way. I agree with you that JIT could achieve this. Although this could be done by JIT, however the JIT approach would require good code generation to produce efficient getter code to return the property value, and there will be a JIT threshold and extra compilation time for caller to reach. > -- > PHP Internals - PHP Runtime Development Mailing List > To unsubscribe, visit: http://www.php.net/unsub.php > > -- Sent from Gmail Mobile --001a1141ca60a12bea052e9b78a2--