Mailinglist Archive: opensuse-amd64 (342 mails)

< Previous Next >
Re: [suse-amd64] g++ 3.3.3 -m64 -O3
  • From: "Arne" <ComradeTux@xxxxxxxxxx>
  • Date: Sun, 6 Feb 2005 19:03:45 +0000 (UTC)
  • Message-id: <200502061903.j16J33D05223@xxxxxxxxxxxxxxxxxx>
On 6.2 2005 16:12, insane@xxxxxxxxxxxxxxxx wrote:

>
>I tried to compile the following code with g++ 3.3.3 (g++ -m64 -O3):
>
>#include <vector>
>#include <algorithm>
>#include <ctime>
>#include <cstdio>
>
>using namespace std;
>
>#define BENCH_TYPE double
>
>int main()
>{
>    vector<BENCH_TYPE> v;
>    printf("Generating 10M elements\n");
>    for (int i = 0; i < 10000000; i++)
>                v.push_back((BENCH_TYPE)(rand()*0.5 + rand()));
>
>        printf("generated\nSorting...\n");
>
>        clock_t start = clock();
>        sort(v.begin(), v.end());
>        clock_t end = clock();
>
>        printf("%f\n", (end - start)/((double)CLOCKS_PER_SEC));
>        return 0;
>}
>
>The resulting executable doesn't finish in a minute or so and I have to break
>its execution. The funny thing is that the same code compiled with g++ -m64
>-O0 finishes in 8 sec or so. What's going on? Any ideas?
>I have Suse 9.1 x86_64 with the latest updates of all installed packages.
>
>I wouldn't bother a lot about this test code, if it wasn't for a more serious
>problem: I downloaded and installed the latest x86_64 build of the kernel
>2.6.5-7.145-default and the nVidia graphics driver stopped working. I
>manually downloaded the latest driver from the nVidia web site:
>NVIDIA-Linux-x86_64-1.0-6629-pkg2.run and installed it and when I started X
>it was painfully slow and I had to kill it.
>
>I don't know if the two problems are related. I would appreciate any help on
>any of them. Thanks a lot.
>
>--
>Check the List-Unsubscribe header to unsubscribe
>For additional commands, email: suse-amd64-help@xxxxxxxx
>
>
Maybe not so much help but NVIDIA-Linux-x86_64-1.0-6629-pkg2.run and your test code works fine on SuSE64 9.2, k2.6.8-24.11-default. Can't help you more, good luck!

Btw it's a big difference: 1.76 vs 9.81 for -O3 and -O0.

------------------------------------------------------------------
Gratis svenskpråkig e-post och förmånliga textmeddelanden
http://webmail.surfnet.fi
------------------------------------------------------------------
< Previous Next >
This Thread