Hi all,
For anyone who hasn't seen it, this appeared today on Hacker News:
- Andrei Alexandrescu: Writing Fast Code I (youtube)
- Andrei Alexandrescu: Writing Fast Code II (youtube)
He started with a detailed description of how he recommends that you benchmark code. At the 44:15 mark, he moved onto "Almost Portable Optimization Techniques", which I found very interesting.
One particularly interesting point he said (at 45:30) was "Prefer (32-bit) array indexing to pointers", which as I mentioned in @andrea's thread, is different from my own (repeatedly-benchmarked) experience. But he also stated a disclaimer that everything he suggests will be untrue for at least one person when they benchmark it. :)
adrianv: we should rewrite the whole standard library to "use uints instead of ints, because they a faster".
This is not actually true (at least not in this general form). If it were, gcc and clang would default to -fwrapv (which makes most signed integer operations other than comparisons and division/remainder bit-for-bit the same as their unsigned counterparts on two's complement machines). You can argue that this relies on some really ugly warts in the C/C++ standards, but since we're talking about C/C++ here, it's pretty much unavoidable.
The discussion jboy started is funny, IMHO. If Nim might have problems then I'm sure it isn't about speed. :-)
On the contrary, I find Nim pretty fast to say it with some understatement.