Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:77063 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 53137 invoked from network); 5 Sep 2014 06:45:45 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 5 Sep 2014 06:45:45 -0000 Authentication-Results: pb1.pair.com smtp.mail=dmitry@zend.com; spf=pass; sender-id=pass Authentication-Results: pb1.pair.com header.from=dmitry@zend.com; sender-id=pass Received-SPF: pass (pb1.pair.com: domain zend.com designates 209.85.220.182 as permitted sender) X-PHP-List-Original-Sender: dmitry@zend.com X-Host-Fingerprint: 209.85.220.182 mail-vc0-f182.google.com Received: from [209.85.220.182] ([209.85.220.182:44905] helo=mail-vc0-f182.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id C9/30-51136-81C59045 for ; Fri, 05 Sep 2014 02:45:45 -0400 Received: by mail-vc0-f182.google.com with SMTP id im17so12010060vcb.13 for ; Thu, 04 Sep 2014 23:45:42 -0700 (PDT) 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:content-type; bh=Au/ATB7jUszRVX7LuIMvnxR98CtQj0zzQWIOaqMKWgA=; b=Dy6g/kwX7tgqH3yrVGqDmIfoA3WFoX8lFj75GBRxGSkALPPWbO1avlItMme+aqAuKF vc/qDWT1wmyHATLBLGQmqyndCvHPiDMi2k7WUq3UCJuSJJFBi4j5WWyFqAC0i23re+w5 GApMmuJCh9aJccUMCedr1+Vxo1GRo9ufeU5P0GREcTVzx2+3nJp/AaG1AZLqtn8bgkNe mw8prf+G51XwRSJ1pC5QVxcANFpoyKtPJj+4clngGsxetx8W4bQOll5o+iMX7ixnQaGY R6uLzvSAO6FZfbjoz2WpU3sNxoxhw2XUZIZCIZOn2IizjickUaBK762K7lgqr1n72Psk odIg== X-Gm-Message-State: ALoCoQnqd/T5n+mCaJu9+X6BFVaatDshAGxQSzjX1r/SovAlxT/4CLGGze5OrqR52YdiPPsiRal1/0eVLlcUKauKWKSM0tXwE1id3FqZesXJshfZ+YEoxU/W5tL2Jz+KRjQP6AYnguLyT2nheGAtMRxH+eKpftTZ9A== MIME-Version: 1.0 X-Received: by 10.52.253.39 with SMTP id zx7mr7342664vdc.2.1409899542000; Thu, 04 Sep 2014 23:45:42 -0700 (PDT) Received: by 10.52.110.170 with HTTP; Thu, 4 Sep 2014 23:45:41 -0700 (PDT) In-Reply-To: <54091826.6050602@sugarcrm.com> References: <54091826.6050602@sugarcrm.com> Date: Fri, 5 Sep 2014 10:45:41 +0400 Message-ID: To: Stas Malyshev Cc: Pierre Joye , Bob Weinand , PHP internals Content-Type: multipart/alternative; boundary=001a1135f63c5ecc8d05024bd117 Subject: Re: [PHP-DEV] Re: Fast zend_parse_parameters API From: dmitry@zend.com (Dmitry Stogov) --001a1135f63c5ecc8d05024bd117 Content-Type: text/plain; charset=UTF-8 It's already done for strlen() - ZEND_STRLEN opcode (and few other functions). But it make no sense to convert all useful functions into opcodes. We need an ability of fast parameter parsing anyway. Thanks. Dmitry. On Fri, Sep 5, 2014 at 5:55 AM, Stas Malyshev wrote: > Hi! > > > As I understand correctly the only reason we have this discussion is > > the performance impact of zpp with some functions, mainly > > ZEND_FUNCTIONs. What prevents us to make them operators? That may > > break things like call_user_func("strlen", $arg), array_map and the > > There's also an issue that strlen("foo") may mean a different thing if > you're in a namespace. So there may be a challenge to do this on > compiler level, at least in the obvious way. But maybe there's a way > around it, so theoretically we could make compiler treat strlen() as > operator, or, more precisely, as an inline function looking like C > function with parameters passed in registers. I.e., what I mean is > skipping the whole parameter-passing and receiving altogether and just > give it the slot where the variable lives. Of course, it would work only > with strlen() and such which do not modify the argument and hardly do > anything with it at all, and strlen would essentially have to have two > implementations - one for "inline" usage and one for "normal" usage > ($foo(), call_user_func(), etc.). But since 99% of actual usage would be > "inline" it may still be beneficial. > > -- > Stanislav Malyshev, Software Architect > SugarCRM: http://www.sugarcrm.com/ > --001a1135f63c5ecc8d05024bd117--