-
Couldn't load subscription status.
- Fork 270
Labels
WIPpriority:p1High priority but not blocking. Causes major but not critical loss of functionality SLA <=7daysHigh priority but not blocking. Causes major but not critical loss of functionality SLA <=7days
Milestone
Description
Currently we instantiate new objects every time for the following properties, this can have a large memory impact for large OpenAPI descriptions. For eg: For the Graph OpenAPI this will create 142k schemas, for a total of 1.1 million objects that might be unused. So we have an opportunity for some memory perf. improvements by lazily instantiating these.
public virtual IDictionary<string, OpenApiSchema> PatternProperties { get; set; } = new Dictionary<string, OpenApiSchema>();
public virtual IList<JsonNode> Enum { get; set; } = new List<JsonNode>();
public virtual IList<OpenApiSchema> AllOf { get; set; } = new List<OpenApiSchema>();
public virtual IList<OpenApiSchema> OneOf { get; set; } = new List<OpenApiSchema>();
public virtual IList<OpenApiSchema> AnyOf { get; set; } = new List<OpenApiSchema>();
public virtual ISet<string> Required { get; set; } = new HashSet<string>();
public virtual IDictionary<string, OpenApiSchema> Properties { get; set; } = new Dictionary<string, OpenApiSchema>();
public virtual IDictionary<string, IOpenApiExtension> Extensions { get; set; } = new Dictionary<string, IOpenApiExtension>();
A couple of different ideas were identified:
- Lazy Instantiation: Explore using the init pattern and lazy get instantiation to reduce unnecessary object allocations in the
OpenAPISchema - Structs vs. Classes: Evaluate the possibility of redefining
OpenAPISchemaand other types as structs instead of classes to improve performance. IDictionaryproperties should have a default value and no setter.
Metadata
Metadata
Assignees
Labels
WIPpriority:p1High priority but not blocking. Causes major but not critical loss of functionality SLA <=7daysHigh priority but not blocking. Causes major but not critical loss of functionality SLA <=7days