Skip to content

Tech debt: Feature Flags validates the full schema on every evaluate(), including cache hits #8426

Description

@dreamorosi

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

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

tech-debtTechnical Debt tasks

Type

No type

Projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions