OData / WebApi

OData Web API: A server library built upon ODataLib and WebApi
https://docs.microsoft.com/odata
Other
854 stars 475 forks source link

Can startup time be reduced #2468

Open henrikdahl8240 opened 3 years ago

henrikdahl8240 commented 3 years ago

I am using OData 7.4.1 intensively.

It takes a lot of time to have the initial model to be built and make everything ready for serving.

Isn't it possible to have this time to be very significantly reduced?

xuzhg commented 3 years ago

@henrikdahl8240 Do you mind let me transfer this to webapi repo?

By the way, do you have performance profiler?

henrikdahl8240 commented 3 years ago

@xuzhg I'm sorry I initially posted to a sub-optimal repo.

@xuzhg I have never used that. Generally I tend to have great focus at the nature of algoritms and their order of execution time.

@xuzhg Perhaps you can just instruct me, how I should provide you the information on profiling, you pay attention to?

ElizabethOkerio commented 3 years ago

@henrikdahl8240 Can you please provide us with more information on how big your model is?

henrikdahl8240 commented 3 years ago

@ElizabethOkerio I have tried to query the resulting model like this:

sb.AppendLine($"Number of EntitySets: {Builder.EntitySets.Count()}");
sb.AppendLine($"Number of EntityTypes: {Builder.StructuralTypes.OfType<EntityTypeConfiguration>().Count()}");
sb.AppendLine($"Number of ComplexTypes: {Builder.StructuralTypes.OfType<ComplexTypeConfiguration>().Count()}");
sb.AppendLine($"Number of Actions of EntityTypes: {Builder.Operations.OfType<ActionConfiguration>().Count()}");
sb.AppendLine($"Number of Functions of EntityTypes: {Builder.Operations.OfType<FunctionConfiguration>().Count()}");

It gives this result:

Number of EntitySets: 312
Number of EntityTypes: 1083
Number of ComplexTypes: 241
Number of Actions of EntityTypes: 9859
Number of Functions of EntityTypes: 27

Does it fulfill what you asked for or you would like to get more information?