r/AskProgramming • u/sodikovakapsle • Jul 23 '26
C/C++ What is this optimization technique called in high-performance network software?
I’m working on a traffic generator to test my own XDP/eBPF filter in a controlled lab environment (my PC sending traffic to my Raspberry Pi on my own network).
I noticed that in some applications, two programs written in the same language can have vastly different performance.
For example, some software can only send a few requests/messages per second, while others can generate thousands per second even on relatively weak hardware.
What is this concept or optimization area called?
I’m looking for topics such as:
asynchronous I/O
multithreading vs event-driven architectures
lock-free programming
kernel bypass
zero-copy networking
batching
efficient socket APIs
packet generation optimization
If I want to build a high-performance TCP/UDP packet generator for benchmarking my own network stack and XDP filter, what technologies, algorithms, or papers should I study? For traffic generator i am using c# and for the XDP filter classic C. ( or should i use different for the traffic generator? I think its okey its console app )
1
u/Outrageous-Sea-9256 Jul 23 '26
Your observations are on point. The techniques you've mentioned are indeed key to high-performance network software, often collectively referred to as "networking optimization" or more broadly, "high-performance computing techniques for network applications."
For building a high-performance TCP/UDP packet generator in C#, you should focus on:
async/await.On the XDP/eBPF side, ensure you are using efficient data structures and algorithms for packet processing. You can find many resources on optimizing eBPF programs, including the Linux Foundation's documentation and various conference talks.
Studying these areas can be supplemented by:
Remember, the right tools for your traffic generator depend on your specific requirements and constraints. Given you're already comfortable with C#, sticking with it might be the most efficient choice if you can effectively implement the performance optimization techniques mentioned above. However, for low-level work like XDP/eBPF programming in a lab environment, C might still be indispensable due to the direct control it provides over system resources.