Why is this needed?
FeatureFlags.get_configuration() constructs a new SchemaValidator and walks the whole document on every call. evaluate() and get_enabled_features() each call it, so a handler that evaluates five flags validates the entire document five times per invocation, even when AppConfigStore served the document from the Parameters cache without a network call. For documents with many flags and rules this is wasted CPU on every request.
Which area does this relate to?
Feature Flags
Suggestion
Validate once per fetched document. Options: memoise on id() of the returned dict (the Parameters cache returns the same object until expiry), or have StoreProvider expose a version/etag and cache the validation result against it. Either keeps the "always validate fresh configuration" guarantee while skipping repeat work on cache hits.
Acknowledgment
Why is this needed?
FeatureFlags.get_configuration()constructs a newSchemaValidatorand walks the whole document on every call.evaluate()andget_enabled_features()each call it, so a handler that evaluates five flags validates the entire document five times per invocation, even whenAppConfigStoreserved the document from the Parameters cache without a network call. For documents with many flags and rules this is wasted CPU on every request.Which area does this relate to?
Feature Flags
Suggestion
Validate once per fetched document. Options: memoise on
id()of the returned dict (the Parameters cache returns the same object until expiry), or haveStoreProviderexpose a version/etag and cache the validation result against it. Either keeps the "always validate fresh configuration" guarantee while skipping repeat work on cache hits.Acknowledgment