I have a web API that is using EF Core 5.0.12
. I use the swagger web interface for debugging. I have noticed the first time I call a particular controller action in swagger it is slow (six seconds or more). Subsequent calls to that same action are much faster. I am not entirely sure how swagger calls get faster. In my Asp.Net Core SPA calls made to the API just seems slow every time.
Which got me thinking... Since, Asp.Net Core
by default, disposes of the entity context after each call, would I benefit from using DbContext Pooling
to avoid an EF query compile each time?
I am aware of a prior SO question here. But it seems a bit dated since I am using the latest stable versions of Ef Core and Asp.Net Core do the given answers still apply?