You are not logged in.
Also C2D e6400 @2.6ghz, arch64 and latest stock kernel. With some apps running as well.
$ g++ -march=core2 -mfpmath=sse -O2 -pipe -fomit-frame-pointer test.cpp -o test
$ time ./test
Mon Jun 2 20:46:16 EST 2008
155117520
Mon Jun 2 20:46:19 EST 2008
real 0m2.781s
user 0m2.706s
sys 0m0.010sLast edited by ST.x (2008-06-02 10:50:39)
ARCH64 | XMonad | Configs | myAURpkgs | ArchWiki Contribs | Screenies
Offline
You might want to try using the vanilla 2.6.25 kernel for both distros and _exactly_ the same compiler-flags(Compile with g++ -O2 -fomit-frame-pointer ...) on both distros.
And besides, everyone posting his/her time for running it without saying something useful is _not_ helpful in my opinion.
Last edited by Asgaroth (2008-06-02 12:38:48)
Offline
Things that might affect this, considering you're using the same Ubuntu-compiled binary across multiple distros:
1) Kernel - as people have pointed out, the other distros may be using a different scheduler. What kernel version is in use on PCLinuxOS/Ubuntu vs. ours?
2) Dynamic libraries - did you compile static? If not, then libraries need to be loaded - our libraries may be different versions/compiled differently than the other distros, causing the timing difference.
Offline
At least in this case 2) should be irrelevant, since in the time-consuming part no library calls are used, just plain computation code without leaving the executable and the the few library-calls for output and so on should not make a difference of ~5secs(and the time is measured only for the call to count() by the system("date")-calls.
Offline
time ./test
real 0m7.390s
user 0m7.359s
sys 0m0.008s
slow laptop T2500, 1GB RAM, 5400rpm SATA
Last edited by broch (2008-06-02 14:36:08)
Offline
At least in this case 2) should be irrelevant, since in the time-consuming part no library calls are used, just plain computation code without leaving the executable and the the few library-calls for output and so on should not make a difference of ~5secs(and the time is measured only for the call to count() by the system("date")-calls.
Hm... I suppose that's fair.
Offline
Just adding to the collection. On a busy AMD X2 2.6GHz system using Arch i686:
mån jun 2 16:24:24 CEST 2008
155117520
mån jun 2 16:24:28 CEST 2008
real 0m4.683s
user 0m4.650s
sys 0m0.013s
Offline
Hi, I just tried compiling then running the file on Arch and Ubuntu (Arch one compiled then run on Arch, Ubuntu one compiled then run on Ubuntu) under many different CFLAGS settings. Here is what i got:
-march=i386 -O0:
Arch: 17s
Ubuntu: 10s
-march=i686 -O2
Arch:10s
Ubuntu: 8s
-march=pentium-m -O2
Arch: 12s
Ubuntu: 6s (weird!)
-march=native -O2
Arch: 10
Ubuntu: 8s
-march=native -O3
Arch: 5s
Ubuntu: 5s
-march=pentium-m -O3
Arch: 5s
Ubuntu: 4s
-march=core2 -O2
Arch only: 10s
-march=core2 -O3
Arch only: 5s
All these number were obtained by running the program 3 times. Most of them were consistent across 3 times. Some of them were the result for 2 out of 3 times.
I love Archlinux for its simplicity and responsiveness. By posting those figures, I dont mean to bash anything here, please dont get me wrong. I just want to find where the problem lies in, so that I can fix it ![]()
Versions i used:
Arch: 2008.03, gcc 4.3.0-1, kernel 2.6.24 and 2.6.25-recompiled (tried both)
Ubuntu: 8.04, gcc 4.2.3, kernel 2.6.24, running from the live CD.
For convinience, I repeat: Core 2 Duo T5500 1.66GHz, 2 gigs of RAM. I made no difference whether X was running or not.
Last edited by Mr_Shameless (2008-06-02 15:01:14)
Offline
Pretty strange figures. Maximum difference I get between those options is 0.6s. I'm clueless about how it works on the other hand, but it's kind of interesting anyhow to compare.
Last edited by KimTjik (2008-06-02 15:21:28)
Offline
well with this:
-march=pentium-m -O3
time ./test
Mon Jun 2 08:45:59 PDT 2008
155117520
Mon Jun 2 08:46:02 PDT 2008
real 0m2.834s
user 0m2.819s
sys 0m0.007s
but this is quite normal I assume.
Offline
maybe it's not so much about the running environment as the compiler which generates code.
which gcc version is used in each case? this can lead to very different generated code and optimisations, regardless of switches used for compilation.
also, you're using system("date") which spawns a shell. stop using that, you might jsut end up stating bash that then parses some completions or something... maybe ubuntu will even start /bin/sh which is dash in this case...
Last edited by lloeki (2008-06-02 16:25:23)
To know recursion, you must first know recursion.
Offline
Pentium Dual E2180 @ 2.00GHz 1Gb RAM
[david@darkstar Builds]$ g++ test.cpp -o test
[david@darkstar Builds]$ time ./test
Mon Jun 2 22:34:12 BST 2008
155117520
Mon Jun 2 22:34:19 BST 2008
real 0m7.663s
user 0m7.246s
sys 0m0.077s
[david@darkstar Builds]$ g++ -march=native -O2 -pipe test.cpp -o test
[david@darkstar Builds]$ time ./test
Mon Jun 2 22:34:32 BST 2008
155117520
Mon Jun 2 22:34:35 BST 2008
real 0m3.659s
user 0m3.486s
sys 0m0.017sOffline
How about compiling the code on Arch (passing some sane options to g++) and then time that binary on Arch, Ubuntu, PCLOS, etc.
Then compile the code on another distro using the same g++ options and time that binary on the various distros. My bet is that different GCC versions are the culprit.
-- Dan
Offline
Hmm.. I used to think that it was the difference versions of gcc that resulted in this, but as I said, I already tried the one compiled under Ubuntu 8.04 (gcc 4.2.3) on difference distros, and the result was just like when I compiled the file under each distro.
Offline
Did you really use _exactly_ the same kernel versions including patchsets etc.? I guess that the standard ubuntu kernel is quite different from the vanilla kernel from kernel.org due to patching. Try using the vanilla kernel for both distros, so we could eliminate or determine the kernel as the culprit.(Again use the same binary on all platforms)
And could somebody please explain to me whats the point of the tons of "Runs in $foo seconds on my machine" that don't actually contribute to solving the problem?
Last edited by Asgaroth (2008-06-03 12:35:08)
Offline
5.5 secs on a Pentium 4 @ 2.6 GHz (no multi threading processor). With yesterday pacman -Syu.
Γίνε ρεαλιστής, μείνε ονειροπόλος ...
Offline
How about compiling the code on Arch (passing some sane options to g++) and then time that binary on Arch, Ubuntu, PCLOS, etc.
Then compile the code on another distro using the same g++ options and time that binary on the various distros. My bet is that different GCC versions are the culprit.
That coud be the case, I don't think the pclos/mandriva got gcc 4.3 yet.
Evil #archlinux@freenode channel op and general support dude.
. files on github, Screenshots, Random pics and the rest
Offline
And could somebody please explain to me whats the point of the tons of "Runs in $foo seconds on my machine" that don't actually contribute to solving the problem?
just the same as glxgears fps ![]()
To know recursion, you must first know recursion.
Offline
... and maybe because the title might get interpreted as it's an Arch issue. Figures show it's not, so why not posting them.
Offline
They would only show that, when the times for executing it on the same machine on another distro would also be posted, since they could still be faster than Arch if there's a general flaw at work here. It also is ok, if the poster at least says something that might shed some light into this matter in addition to the execution time, but the posts with just the execution time for their machines only tested on Arch and nothing else is not really helpful.
Offline
Well, I posted it with diff cflags to show that if pclinuxos had some other cflags set by default, it would make a big difference.
But, on the sidenote, there were a thred earlier that also came to the conclusion that some apps executed slower on arch than on ubuntu, even tho it was the same binary.
Evil #archlinux@freenode channel op and general support dude.
. files on github, Screenshots, Random pics and the rest
Offline
Hi, i just compiled on Arch with -march=native -O2, ran on Arch, then tried on Ubuntu with that same binary. Same, Arch 10 seconds, Ubuntu 6 seconds. So, up to now there is only one thing left to think of. It's the kernel patches, right? But I'm afraid I dont have time to install Ubuntu on this same machine to test a vanilla kernel with it. I've always tried on the live CD ![]()
Offline
It also is ok, if the poster at least says something that might shed some light into this matter in addition to the execution time, but the posts with just the execution time for their machines only tested on Arch and nothing else is not really helpful.
OK, to be helpful then, I booted into my Fedora 7 64bit on the same machine. I haven't used it in a while even though I consider it to be a high class system.
Executed: g++ -march=core2 -mfpmath=sse -O2 -pipe -fomit-frame-pointer test.cpp -o test
Arch figures for the newest gcc we've got in the repository for i686 architecture (repetition):
mån jun 2 16:24:24 CEST 2008
155117520
mån jun 2 16:24:28 CEST 2008
real 0m4.683s
user 0m4.650s
sys 0m0.013s
Fedora, gcc 4.1 but now for x86_64 architecture (I don't no the implication of 32- vs. 64-bit in such tasks):
tis jun 3 21:47:09 CEST 2008
155117520
tis jun 3 21:47:13 CEST 2008
real 0m3.679s
user 0m3.664s
sys 0m0.013s
Some variables don't for obvious reasons work on x86_64, but changing to "-O3" the Fedora got even better speed, something that wasn't evident on Arch:
tis jun 3 21:57:00 CEST 2008
155117520
tis jun 3 21:57:03 CEST 2008
real 0m2.881s
user 0m2.851s
sys 0m0.016s
Still I don't know what's a more decisive factor: different kernel + gcc, or different architectures?
Edit after some more tests:
Executed: g++ -march=core2 -O3 -ffast-math -march=opteron test.cpp -o test
Arch i686:
tis jun 3 22:30:07 CEST 2008
155117520
tis jun 3 22:30:11 CEST 2008
real 0m3.230s
user 0m3.210s
sys 0m0.010s
Fedor 7 x86_64:
tis jun 3 22:36:54 CEST 2008
155117520
tis jun 3 22:36:57 CEST 2008
real 0m3.020s
user 0m3.007s
sys 0m0.014s
I read some more and found that speed has varied a lot between gcc versions. The priority according to some haven't been speed but other improvements of its usability. On some systems with previous versions x86_64 tend to be slightly faster.
Trying to be helpful! ![]()
Last edited by KimTjik (2008-06-03 20:39:42)
Offline
Here's another comparison. The only 64bit Ubuntu live CD I had to hand to compare with my 64bit Arch installation is 7.10, so this is kernel 2.6.22 and g++ 4.1.3 pitted against kernel 2.6.25 and g++ 4.3.0. I used march=x86-64 because it's common to both versions of g++ and happens to be the Arch makepkg default. CPU is Pentium Dual E2180 2.00 GHz.
g++ -march=x86-64 -O2 -pipe test.cpp -o test
Ubuntu 7.10 Arch
Tue Jun 3 20:29:22 UTC 2008 Tue Jun 3 21:44:22 BST 2008
155117520 155117520
Tue Jun 3 20:29:26 UTC 2008 Tue Jun 3 21:44:25 BST 2008
real 0m4.094s real 0m3.426s
user 0m4.088s user 0m3.413s
sys 0m0.004s sys 0m0.010s
g++ -march=x86-64 -O3 -pipe test.cpp -o test
Ubuntu 7.10 Arch
Tue Jun 3 20:29:35 UTC 2008 Tue Jun 3 21:44:34 BST 2008
155117520 155117520
Tue Jun 3 20:29:37 UTC 2008 Tue Jun 3 21:44:36 BST 2008
real 0m1.868s real 0m2.005s
user 0m1.856s user 0m1.987s
sys 0m0.008s sys 0m0.020sThe differences don't seem to be that significant. I also tried a 32bit Ubuntu 8.4 live CD and the best I could get was a time around 5s.
Offline
Did anyone try to alter the granularity of the scheduler ?
Of course to do this you need to recompile the kernel with :
CONFIG_SCHED_DEBUG=yAnd then alter your /etc/sysctl.conf
If I want to play WOW without stutters I use:
kernel.sched_features=21
kernel.sched_batch_wakeup_granularity_ns=25000000
kernel.sched_min_granularity_ns=4000000Offline