You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
There is some unnecessary database hits in some modules.
first, we set request.prof_file and immediatelly call method save() on it, but it's not necessary. because method _process_response in the middleware will call save() at the end.
path: collector.finalise
again, method save() is called on request after meta_num_queries and meta_time_spent_queries is set.
unnecessary, because the request object will be saved in the middleware in _process_response
path: collector._record_meta_profiling
in ResponseModelFactory.construct_response_model, a Response object is created by method create(), so it is immediatelly saved to the database. next, Response.raw_body is set and method save() is called in the middleware.
database hits could be decreased
There is some unnecessary database hits in some modules.
first, we set
request.prof_file
and immediatelly call methodsave()
on it, but it's not necessary. because method_process_response
in the middleware will callsave()
at the end.path:
![image](https://user-images.githubusercontent.com/61058406/183478715-55f7b1b1-a00b-4cac-b3e3-d243449db0b0.png)
collector.finalise
again, method
save()
is called on request aftermeta_num_queries
andmeta_time_spent_queries
is set.unnecessary, because the request object will be saved in the middleware in
_process_response
path:
![image](https://user-images.githubusercontent.com/61058406/183479075-61c7b690-fa43-43c9-868d-24e97d3d3523.png)
collector._record_meta_profiling
in
ResponseModelFactory.construct_response_model
, a Response object is created by methodcreate()
, so it is immediatelly saved to the database. next,Response.raw_body
is set and methodsave()
is called in the middleware.database hits could be decreased
model_factory.ResponseModelFactory.construct_response_model
SilkyMiddleware._process_response
The text was updated successfully, but these errors were encountered: