Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

What compiler flags did you use? Perhaps -Os would even things out a little more.


Why would anyone want to optimize for space? On a halfway modern PC at least, some really embedded platform might be a different story.


Cache-friendliness; applies to any platform.

And it's "optimize for size", by the way.


Right, in certain cases. But here it's a networking application. So memory accesses won't be your bottleneck.


gcc-11.2.1-1.fc35.x86_64 with whatever defaults the upstream project chooses.


Did you run CMake with -DCMAKE_BUILD_TYPE=Release ?


No, with -DCMAKE_BUILD_TYPE=RelWithDebInfo


Right, and C++ is definitely going to have more debug info because of longer symbol names.

Test the two with Release instead. That will give you real results.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: