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
> 



-- 
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to