Comment 12 for bug 636193

Revision history for this message
Benji York (benji) wrote : Re: [Bug 636193] Re: feature flags need to self document

On Thu, Jan 6, 2011 at 3:07 PM, Robert Collins
<email address hidden> wrote:
> zcml registration is slowa major component of appserver and test suite
> startup time and very inefficient at runtime.

I can attest to ZCML processing being a large component of LP (and other
large Z3 based apps I've worked with) start up time. I don't know how
much of that work is essential, but in this case, it's hard to imagine
that registering the flags using the ZCA would be measurably slower than
making a few function calls.

As for "runtime", if you mean looking up things in the ZCA registry,
lookups are highly optimized and the times I've benchmarked it (most
recently at the Prague sprint), amortized lookups have been very close
to the time to do a single dictionary lookup.

That being said, I think the ZCML discussion is moot. I plan on doing
the following for this issue:

A) implement a scopes registry (as a data structure) in
   lp.services.features
B) have a documentation-only feature flag registry of (name, domain,
   description).
C) There will be no enforcement of registered feature flags. If an
   unregistered feature flag is requested no exception will be raised.
D) Scope registration will be required and enforced.
E) On the through-the-web display of feature flags, domains, and
   documentation include a list of feature flags that have been seen
   during the process' lifetime for which there is no documentation
   available so as to help us know when we've forgotten to document a
   feature flag.

That leaves where the information should be displayed. The feature
flags configuration page seems like a good place since the information
will be near you when you're making changes, so I'll put them there or
have a prominent link to them from there.

Another question I have is that you said that order matters for scopes.
I think what you mean by that is that scopes should be looked up in a
consistent order to avoid variable run-time behavior if more than one
scope handler would claim a particular scope string. To enforce
consistently I'm going to store scope handlers in a list so they will be
consulted in a consistent order.
--
Benji York