Julian Andres Klode: simple code clang creates 1600x faster executable than gcc
The following program, compiled with clang 1.1, runs 500 times faster than the gcc4.5-compiled code (in both cases with -O2):
Filed under: General
#include <stdio.h> #define len 1000000000L unsigned long f(unsigned long a, unsigned long b) __attribute__((noinline)); int main() printf("%lu\n", f(0, 2*len)); return 0; unsigned long f(unsigned long a, unsigned long b) unsigned long sum = 0; for (; a < b; a++) sum += a; return sum;Now, I would be interested to see what s happening here. I took a look at the assembler code both compilers create, but the only thing I found out so far is that gcc s assembly is easier to understand 50 lines (gcc) vs 134 lines (clang). If someone knows the answer, please tell me. Also see http://lwn.net/Articles/411776/ for a C++ version that calls
f() via boost::thread.
Update: I also reported a bug at http://gcc.gnu.org/bugzilla/show_bug.cgi?id=46186.
Filed under: General
For some time now, we ve been gearing up to begin development on Ubuntu 11.04. While some folks have been putting the finishing touches on the 10.10 release, and bootstrapping the infrastructure for 11.04, others have been meeting with Canonical stakeholders, coordinating
The
The bad news is that you won t be able to use ZFS as your root filesystem in Debian Squeeze with the official installer. The blocker is missing support in GNU Parted. Unfortunately the
As Christian
It's now time for me to move and use the
As some of you might know, I'm an
Needless to say that I'm planning to switch my scripts to Vala for 2.0.
More than year ago, I've generated mysel new PGP key (4096 bit RSA), with intention to
Many people know