DPDK is written in C and it is expected to be used in C environments. Yes I know, there are exports ready for C++ usage all over the lib, but if you ever tried to include DPDK code into your C++ application then you’ve already discovered that’s actually quite tricky to build DPDK with C++ toolchains. […]
compilers
Unexpected stuff!

Let’s have a look at this code: int main() { for(int i{0};i<500;i++) { std::cout<<“This is a big number: “<<i*20000000<<std::endl; } } And let’s compile it with g++ using the flag -O3, what’s going to happen? Before answering, let’s have a look at the assembly, shall we? L16: movsbl 39(%ebx), %eax L6: movl %esi, %ecx movl […]
Almost useless knowledge

Is almost useless because nobody is going to raise yours salary for that! Or maybe someone will?!? Let’s say we ignore all the benefits of all the optimizations our benevolent compiler is going to made on our code, and have a look at what happen when we execute some hundreds of thousands of times two very […]
- C++
- ...
IO Stream performance.

Many of the competitive programming portals available on the web advice –for certain problems involving huge input reading or output printing– the user to avoid cin/cout in spite of printf/scanf: As input/output can reach huge size it is recommended to use fast input/output methods: for example, prefer to use scanf/printf instead of cin/cout in C++, prefer to use […]