5 ms·
GCC produces almost 30% more instructions for the C version at -O3 level as opposed to -O2. Clang produces practically the same between the two levels. On OS
by berkut 10y ago
GCC produces almost 30% more instructions for the C version at -O3 level as opposed to -O2.
Clang produces practically the same between the two levels.
On OS X, so can't test if this actually makes a performance difference.
- claudius 10y agoOn my laptop (i7-5500U), I get the following timings (always with -march=native or -xHOST): GCC 6.3, -Ofast: 5.93s GCC 6.3, -O3: 93.06s GCC 6.3, -O2: 134.43s Clang 3.9, -O3: 346.92s Clang 3.9, -Ofast: 5.87s Intel 15.0, -O3: 110.84s Intel 15.0, -Ofast: 106.88s The Intel compiler is relatively old, but mostly it seems to be a case of IEEE 754 conformance -- if enabled, things take longer, if disabled, they’re (probably) as fast in C as in Rust.
- eriknstr 10y ago>On OS X, so can't test if this actually makes a performance difference. The `time` command is part of base OS X.
- Sean1708 10y agoBut gcc is not.
- eriknstr 10y agoIn my reading of the comment it seemed to imply that the commenter already had both clang and gcc installed on their computer since they were talking about the amount of instructions produced by each. Perhaps I misunderstood?
- Sean1708 10y agoI'm not sure, to be honest. I just assumed they were running GCC in a VM, but actually there was no real reason for me to assume that.