MIT open courseware has a course on Performance Engineering which details some of the types of low level optimizations that can be done. It requires a lot of measuring and problem specific solutions.
I’ve helped with that course in the past. It’s awesome. It’s completely unrelated to WAN networking. I found the IETF groups working on these problems more helpful.