I'm trying to send requests to a microservice running on localhost. I'm using requests.session() for the python client because I want to keep the connection open for more requests. I measured the performance, the overhead, and it's quite slow ~ 4ms. I tried to send the same request from other clients (JS for example) and it was much faster (0.5 ms). Any ideas ?
The code is very simple-
session_holder = requests.Session()
session_holder.post(url, json= data, headers=headers)