Live data from Hacker News

"Hello World" in C++, compiled to x86 Assembly

gist.github.com

1–4 of 4 posts

Re: "Hello World" in C++, compiled to x86 Assembly

#3
Without and with some optimization i get this results.

g++ -o hello hello.cpp

objdump --disassemble hello | wc -l

289

With some optimization

g++ -o hello hello.cpp -O3 -fno-rtti -fno-exceptions -fmessage-length=0 -funroll-all-loops -fomit-frame-pointer -falign-loops=2 -falign-jumps=2 -falign-functions=2 ;

objdump --disassemble hello | wc -l

256