Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 18 Feb 2009 17:53:56 -0500
From:      Jung-uk Kim <jkim@FreeBSD.org>
To:        freebsd-questions@freebsd.org
Cc:        Kailash Kailash <kailash.kailash@zscaler.com>
Subject:   Re: FreeBSD 7.O compiled code is very slow
Message-ID:  <200902181753.59988.jkim@FreeBSD.org>
In-Reply-To: <499c7357.14098e0a.1394.ffffda2d@mx.google.com>
References:  <499c7357.14098e0a.1394.ffffda2d@mx.google.com>

next in thread | previous in thread | raw e-mail | index | archive | help
On Wednesday 18 February 2009 03:44 pm, Kailash Kailash wrote:
> I am using FreeBSD 7.0 in 64 BIT mode. Same code compiled on BSD
> 7.0 runs 50% speed (as expected by CPU and code architecture)
> compared to BSD 6.2. Here is one real code with binary output. On
> 3.0 GHz Woodcrest processor, I am able to copy from one cache to
> another cache at the speed of 24Gbytes/second verses 12
> Gbytes/second. Any help is appreciated.

You may try "-fno-ivopts".  I think the bug is:

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=27440

Jung-uk Kim

> Thanks,
>
> Kailash
>
>
>
> Source-code:
>
> #define BACKWARD_MEMCOPY_WITH_TYPE(dp, sp, len, type)
> BACKWARD_MEMCOPY((type*)(dp), (const type*)(sp),
> ((len)+(sizeof(type)-1))/sizeof(type))
>
>
>
> #define BACKWARD_MEMCOPY(dp, sp, len) \
>
> do { \
>
>         smwbits __len = len;            /* must be signed value */
> \
>
>         while (--__len >= 0) \
>
>                 (dp)[__len] = (sp)[__len]; \
>
> } while (0)
>
>
>
> BSD 6.2 code
>
> 0x00000000004353b2 <smcli_memory_copy_performance+434>: mov
> 0x8(%rbp,%rdx,8),%rax
>
> 0x00000000004353b7 <smcli_memory_copy_performance+439>: mov
> %rax,0x48(%r12,%rdx,8)
>
> 0x00000000004353bc <smcli_memory_copy_performance+444>: dec    %rdx
>
> 0x00000000004353bf <smcli_memory_copy_performance+447>: jns   
> 0x4353b2 <smcli_memory_copy_performance+434>
>
>
>
> BSD 7.0 code
>
> 0x000000000040cb80 <smcli_memory_copy_performance+272>:        mov
> 0xfffffffffffffff8(%rsi),%rax
>
> 0x000000000040cb84 <smcli_memory_copy_performance+276>:        mov
> %rax,0xfffffffffffffff8(%rcx)
>
> 0x000000000040cb88 <smcli_memory_copy_performance+280>:        sub
> $0x8,%rsi
>
> 0x000000000040cb8c <smcli_memory_copy_performance+284>:        sub
> $0x8,%rcx
>
> 0x000000000040cb90 <smcli_memory_copy_performance+288>:        sub
> $0x1,%rdx
>
> 0x000000000040cb94 <smcli_memory_copy_performance+292>:        jns
> 0x40cb80 <smcli_memory_copy_performance2+272>



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200902181753.59988.jkim>