Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:92328 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 32967 invoked from network); 15 Apr 2016 09:31:51 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 15 Apr 2016 09:31:51 -0000 Authentication-Results: pb1.pair.com header.from=cornelius.howl@gmail.com; sender-id=pass Authentication-Results: pb1.pair.com smtp.mail=cornelius.howl@gmail.com; spf=pass; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmail.com designates 209.85.214.173 as permitted sender) X-PHP-List-Original-Sender: cornelius.howl@gmail.com X-Host-Fingerprint: 209.85.214.173 mail-ob0-f173.google.com Received: from [209.85.214.173] ([209.85.214.173:35222] helo=mail-ob0-f173.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id E2/70-29891-605B0175 for ; Fri, 15 Apr 2016 05:31:50 -0400 Received: by mail-ob0-f173.google.com with SMTP id n10so3482672obb.2 for ; Fri, 15 Apr 2016 02:31:50 -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; bh=b3jJ6DRHvaDBHo4ZnmvnEwBg1/fPr1UCgJGi7WbBY+E=; b=i789BI/p6bGD4sXwUwaYDAbTcX4BN7nX+aNi7GnqfNJe+iK9ZxxMTR9/7hJH/g1bfP Fpt3ZwkFV+t0Bh1zN43kT6lRmy9CARSiNrXyZRkjFRMmczCi0PPmnrFeFEM2sllLwirS s2hem3QjLe0jKtHcpDr6ykl/y2DLPqbGgfvV2uz0r2yoxBrg9ERMlqJz00Y7pgWknJdY IEeqwVfKpu2iPZ/+2sb/liZHrv/N147PUa2kyNBTkXUxOkruEL/KEkxZB8E1yECX/ufx 2Dl0bAbokEuu/wT9r9l2O3fUeBTnkvsnFID2OiB3y9amUd93/Z0Zo2bZeaYNXH/O+OWe pasg== 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; bh=b3jJ6DRHvaDBHo4ZnmvnEwBg1/fPr1UCgJGi7WbBY+E=; b=G14rKkeiUd7gUZ175h9vJEqJ5BvIx5R3HPufCQJH7RSS8dhtLADLSc62TZsAgTuzuB s8qANN9iptZKmN8d6Itqe5ZafeGt6fGONNo1uidzYadJ7xuUNd61np2frmAzUCa9qTjM kGYFfk9PTwSfejyelsmf/wFyKVe6Ux5+m1Nx7arekTliJfOmbVD5Mp76OcxE6AZaD0p0 eqNV9MAprckczgXFvIy2RiW48Wf9gQgFHG/3shJsHyf4qVtD2xhdZYtmSZalyZMoiRk1 QcBudg17a7yZa6TzeOzuzb1idRXr/tLcQdxg0rJ3K5hB38Dp4YCiFHjcYDT6W8+PMKA5 P0bA== X-Gm-Message-State: AOPr4FWM5p2/mwKMQ7NjHxDYGPTsfoT0UtRoXLfg1Yu8J3GcD7gaBox9NQoPhqftMq89+9es6T+AEXmNBLtHWw== MIME-Version: 1.0 X-Received: by 10.60.150.235 with SMTP id ul11mr10098706oeb.70.1460712707999; Fri, 15 Apr 2016 02:31:47 -0700 (PDT) Received: by 10.157.7.194 with HTTP; Fri, 15 Apr 2016 02:31:47 -0700 (PDT) In-Reply-To: References: Date: Fri, 15 Apr 2016 17:31:47 +0800 Message-ID: To: "internals@lists.php.net" Content-Type: multipart/alternative; boundary=047d7b5d946314536a053082aeea Subject: Re: optimization for function call without paremters From: cornelius.howl@gmail.com (Lin Yo-An) --047d7b5d946314536a053082aeea Content-Type: text/plain; charset=UTF-8 I think this optimization could be done by two approach: 1. Add another FCALL op, which init a function call and call that function directly for functions without parameters. 2. Let the original INIT_FCALL support "call function when the number of parameter == 0" On Fri, Apr 15, 2016 at 5:27 PM, Lin Yo-An wrote: > Hi Dmitry, > > > I found that INIT_FCALL doesn't use opline->result.var and DO_ICALL > doesn't use op1 or op2. The original purpose of separating these two op was > for sending parameters. > > However, if a function doesn't need parameters and it's an internal > function, I think the operation could be merged into INIT_FCALL. > > So I guess we can do this below to reduce one bytecode for each function > call without parameters: > > if (opline->extended_value == 0) { > // call the function directly and store the value in the result. > } > > Your thoughts? > > > > > Best Regards, > > Yo-An Lin > -- Best Regards, Yo-An Lin --047d7b5d946314536a053082aeea--