Networking performance
Since networking is comparatively slow, we have to be smart about ways to improve the throughput of the data. We can control local networks, ensuring we have optic fiber and super-fast routers everywhere, but that does not solve the issues. Even the fastest physical network is way slower than data handled in the CPU. Of course, having fast hardware helps. But it only helps on our own network: we cannot control the hardware on other networks. We must be wise in our code to get the most out of our networking. Once again, it all comes down to us, the developers!
Connection pooling
A connection represents an open line between a client and a server. Let’s look at the following line of code:
var client = new TcpClient("my.server.com", 123);
This single line of code is simple enough: this creates a connection to a server called my.server.com
on port 123
and returns the open connection. Fine. We’ve seen that before. But let me show...