qbittorrent / qBittorrent

qBittorrent BitTorrent client
https://www.qbittorrent.org
Other
28.54k stars 4k forks source link

Optimize converting TCP endpoints to strings #21770

Closed glassez closed 2 weeks ago

glassez commented 3 weeks ago

There may be quite a few endpoint names (one for each available network card), and they usually remain unchanged throughout the session, while previously producing such names was performed every time they were accessed. Now they are retrieved from the cache.

glassez commented 2 weeks ago

Also the PR title is misleading. It is not about (remote) tracker endpoint names but rather IP + port strings.

Who said about remote endpoints? It is about local endpoints of tracker entries.

IP + port

Which is called "endpoint".

How about Optimize converting TCP endpoints to strings?

Chocobo1 commented 2 weeks ago

Who said about remote endpoints? It is about local endpoints of tracker entries.

Sure, but when you phrase it as "tracker endpoint" name, it is usually referring to the remote tracker endpoint.

How about Optimize converting TCP endpoints to strings?

Or Optimize converting endpoints to strings since endpoint has little to do with TCP.

glassez commented 2 weeks ago

Or Optimize converting endpoints to strings since endpoint has little to do with TCP.

Endpoint is a broad term. It can be used in relation to various things, in particular, to network protocols of different levels. Here we refer specifically to the TCP endpoint, i.e. IP address + port number. And that's even how it is called by Boost (and accordingly by libtorrent and qBittorrent, don't you see it in affected code?), so I don't see any point in resisting it. But if you intend to insist on your personal opinion, then I would rather change the name to Optimize converting endpoints to strings instead of delaying this PR any more.

P.S. Commit title will be changed while merging.