go-gitea / gitea

Git with a cup of tea! Painless self-hosted all-in-one software development service, including Git hosting, code review, team collaboration, package registry and CI/CD
https://gitea.com
MIT License
44.22k stars 5.42k forks source link

httplib creates a new Client every request #6764

Open lunny opened 5 years ago

lunny commented 5 years ago

The client connection will not be reused.

stale[bot] commented 5 years ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs during the next 2 weeks. Thank you for your contributions.

6543 commented 4 years ago

@lunny is this still the case?

back ground info?

lunny commented 4 years ago

I think yes. For HTTP/2 , if you request the same site. The http client will reuse the TCP connections. But if you create the client every request, the preformance is slower.

图片
lunny commented 1 year ago

maybe https://github.com/imroc/req is a better choice.