Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:49633 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 35748 invoked from network); 13 Sep 2010 17:31:29 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 13 Sep 2010 17:31:29 -0000 Authentication-Results: pb1.pair.com smtp.mail=kontakt@beberlei.de; spf=permerror; sender-id=unknown Authentication-Results: pb1.pair.com header.from=kontakt@beberlei.de; sender-id=unknown Received-SPF: error (pb1.pair.com: domain beberlei.de from 87.230.78.165 cause and error) X-PHP-List-Original-Sender: kontakt@beberlei.de X-Host-Fingerprint: 87.230.78.165 www.mysqlusers.de Linux 2.5 (sometimes 2.4) (4) Received: from [87.230.78.165] ([87.230.78.165:42273] helo=beberlei.de) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id CA/F8-24501-FEF5E8C4 for ; Mon, 13 Sep 2010 13:31:28 -0400 Received: from [192.168.1.34] (koln-4d0b10d9.pool.mediaWays.net [77.11.16.217]) by beberlei.de (Postfix) with ESMTPSA id 1E43725A0090 for ; Mon, 13 Sep 2010 19:31:24 +0200 (CEST) To: internals In-Reply-To: <4C8E58E7.1080302@lerdorf.com> References: <4C873C0F.1010200@zend.com> <4C879613.7090709@zend.com> <4C887D2B.2000605@zend.com> <4C8AC526.7000505@sugarcrm.com> <4C8B6168.30504@mohiva.com> <4C8BC81E.8000605@sugarcrm.com> <7.0.1.0.2.20100913145703.0d226d90@zend.com> <0f5a11f744bbcf99d8217f40da3a302a@beberlei.de> <4C8E58E7.1080302@lerdorf.com> Content-Type: text/plain; charset="UTF-8" Date: Mon, 13 Sep 2010 19:31:23 +0200 Message-ID: <1284399083.3440.36.camel@benny-pc> Mime-Version: 1.0 X-Mailer: Evolution 2.28.3 Content-Transfer-Encoding: 7bit Subject: Re: [PHP-DEV] Re: PHP Annotations RFC + Patch From: kontakt@beberlei.de (Benjamin Eberlei) Hello Rasmus, Isn't any configuration by xml or ini files runtime configuration? Any configuration that is not resulting in code being generated or code being op-code cached will be-executed on every single request. That applies to almost any configuration mechanism used in PHP applications. Sure there are use-cases with PHP that can't afford any runtime configuration for performance reasons, but that is not the kind of php code were annotations are very helpful anyways, since they only have little integration into libraries or frameworks that require configuration. Talking performance: Annotations as implemented by the patch would be better than file-based configuration mechanisms, because they are evaluted at parse time, only once - making their internal datastructure cachable by APC. No stat calls for external files required. The code being executed to actually bring the information inside the annotations surely creates overhead, but so does every other "runtime" generation of datastructures that could potentially be static through written code. greetings, Benjamin On Mon, 2010-09-13 at 10:01 -0700, Rasmus Lerdorf wrote: > On 9/13/10 8:38 AM, Benjamin Eberlei wrote: > > The primary target for annotations are framework and library integrations: > > validation, forms, metadata mapping, static mvc configuration such as > > routing, view selection or acls. Why do these features not exist with > > current php libraries yet? Because developers see php doc blocks for what > > they are: Comments! > > I think my main issue with these use cases is that I fundamentally don't > believe they should be done at runtime. These are all things that are > not going to change from one request to the next and as such should not > be evaluated on every single request. > > -Rasmus >