Optimization is a very broad topic when referring to compiled languages like C or C++. There are many good guides on that topic. However, I see that people nevertheless forget about a few basic principles; thus I’d like to write a few short words myself, explaining how to avoid common pitfalls when optimizing or at least trying to.
First of all, I’d like to notice that I will be considering optimization as targeted towards making the program execution time shorter through use of faster code (algorithms, methods). I will not cover the area in detail but just give a few tips or remainders which should be taken into account when optimizing.
I’m a bit curious about sizes of various integral types on different platforms, and I’d really appreciate a little help from people running various non-common architectures/toolchains. I’ve prepared a little package which just tries to get various type sizes using the C++ compiler, and I’d really appreciate if you could run it and paste the results in a comment.
To run it:
tar -xf cxx-type-sizes-0.tar.bz2
It will try to compile a few programs, and then run them. Then it concatenates the results into
output/_all and that’s the file I’d like to get, along with your platform, toolchain, and everything else you consider relevant.
I’d really like to get a single output for each architecture, and possibly additional outputs if some toolchain/other magic resulted in different results than the previous one. I’ll put the results then into a nice table. Thanks in advance.