Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:74511 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 74926 invoked from network); 27 May 2014 02:56:58 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 27 May 2014 02:56:58 -0000 Authentication-Results: pb1.pair.com smtp.mail=smalyshev@sugarcrm.com; spf=pass; sender-id=pass Authentication-Results: pb1.pair.com header.from=smalyshev@sugarcrm.com; sender-id=pass Received-SPF: pass (pb1.pair.com: domain sugarcrm.com designates 108.166.43.107 as permitted sender) X-PHP-List-Original-Sender: smalyshev@sugarcrm.com X-Host-Fingerprint: 108.166.43.107 smtp107.ord1c.emailsrvr.com Linux 2.6 Received: from [108.166.43.107] ([108.166.43.107:53888] helo=smtp107.ord1c.emailsrvr.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id B0/81-00171-8FEF3835 for ; Mon, 26 May 2014 22:56:57 -0400 Received: from localhost (localhost.localdomain [127.0.0.1]) by smtp14.relay.ord1c.emailsrvr.com (SMTP Server) with ESMTP id CAF543806CD; Mon, 26 May 2014 22:56:53 -0400 (EDT) X-Virus-Scanned: OK Received: by smtp14.relay.ord1c.emailsrvr.com (Authenticated sender: smalyshev-AT-sugarcrm.com) with ESMTPSA id BC8F43803C5; Mon, 26 May 2014 22:56:52 -0400 (EDT) Message-ID: <5383FEF3.3070309@sugarcrm.com> Date: Mon, 26 May 2014 19:56:51 -0700 Organization: SugarCRM User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.7; rv:24.0) Gecko/20100101 Thunderbird/24.5.0 MIME-Version: 1.0 To: Xinchen Hui CC: Pierre Joye , Bob Weinand , Andrea Faulds , Dmitry Stogov , Zeev Suraski , PHP Internals , Andi Gutmans , Nikita Popov References: <-6285448086228171932@unknownmsgid> <67d97efff27b61e45ef74d4f4339b4b3@mail.gmail.com> <962B3020-200F-45D2-8FEC-AD7A0BFDA50E@ajf.me> <5383F329.3050106@sugarcrm.com> In-Reply-To: Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Subject: Re: [PHP-DEV] RE: [RFC] Fast Parameter Parsing API From: smalyshev@sugarcrm.com (Stas Malyshev) Hi! > then when doing register internal function. Zend vm will bind the Z_ARG_STR to > > int num_args = 0; > (zend_internl_functions > *)(strlen_function)->argument_handlers[num_args++] = > zend_parse_parameter_str; > > the zend_parse_parameter_str here is the handler only handling with > str(which will be effective) That's what I was talking about when I was mentioning function pointers, but then we'll still have a loop with a bunch of function calls instead of an unrolled loop like the current proposal does. Which is more expensive since the execution flow has to jump back and forth... > this implementation will doing 5 functions call..... which > maybe slower than previous zend_parse_parameter Yes, exactly. So far I didn't find any good idea (well, short of implementing real JIT which sounds hard) that would fix that problem. Maybe we could do the same we did with the opcodes - have additional step of generating the arg parsing code and the data for each function before compiling. But doing it for every function seems to be overkill and will complicate the build system a lot. -- Stanislav Malyshev, Software Architect SugarCRM: http://www.sugarcrm.com/ (408)454-6900 ext. 227