我有这个方法
class RunningQuizAuthenticationView(APIView):
def dispatch(self, *args, **kwargs):
print(time.time())
return super(RunningQuizAuthenticationView, self).dispatch(*args, **kwargs)
def get(self, request: Request, key: str) -> Response:
print(time.time())
.....
......
现在,一旦我得到了两个时间,我就差不多这个时间,差异时间大约是30毫秒,你能解释一下为什么这花了这么多时间,因为登录请求需要大约0毫秒,但对于其他请求从调度方法到达目标方法需要很长时间,请帮帮我,谢谢
1 回答
我遇到了瓶颈,它是APIView的内部调度方法,它调用了大约30ms的“perform_authentication”方法,