The elapsed time of a POST request depends on many factors, including the size of the payload, the complexity of the server-side processing, network latency, and the current traffic on the server. An increase in elapsed time from 1 second to 4 seconds could indicate a problem with the server, such as increased traffic or a slow processing algorithm. However, it could also be normal if the payload being sent in the second request is larger or more complex than the payload in the first request.
To optimize the speed of the POST requests, you can try the following:
Minimize the size of the payload by only sending the necessary data.
Compress the payload before sending it.
Use a faster network connection.
In terms of other libraries that could be faster, it ultimately depends on the specific implementation and use case. Some alternative libraries for making HTTP requests in Python include httplib, httplib2, and treq. You could try experimenting with these libraries to see if they provide any performance improvements, but without a specific use case and more information, it is difficult to make any specific recommendations.