On 01/28/2010 04:03 PM, Jerry wrote:
> On Thu, 28 Jan 2010 15:19:47 +0200
> Török Edwin <edwinto...@gmail.com> articulated:
>
>   
>> On 01/28/2010 02:40 PM, Jerry wrote:
>>     
>>> I was wondering if 'clamav' is a true 64-bit program
>>>       
>> Please be more explicit. What Operating System are we talking about?
>>     
>
> The OS is FreeBSD. I presently have a 32-bit system; however, I will be
> upgrading to a full 64-bit system.
>   

ClamAV is developed and tested mostly on Linux/x86_64.
So yes, building it as a 64-bit application is supported.

>   
>>>  or simply one that
>>> runs on both 32 & 64 bit operating systems.
>>>       
>> It can be compiled both as both a 32-bit and a 64-bit binary.
>>     
>
> I realize that it can run on both systems, many software packages do
> that. However, extremely few take full advantage of the 64-bit
> architecture. I was just wondering if Clamav did. 

It is important the compiler is able to compile/optimize for the 64-bit CPU.
Then ALL applications will take advantage of your CPU's features.

There are 4 important aspects about a 64-bit system IMHO:
1. Able to access/allocate more than 4GB of files/memory
 This is useful for databases for example, but not for ClamAV (we don't
scan files that large, and it doesn't need 4G of memory to run)
This is actually a disadvantage for ClamAV, since pointers take up more
space, and thus the memory used by the database is higher than on 32-bit.

2. All amd64 CPUs support at least SSE2
 Compilers will by default optimize for that.
On 32-bit systems your OS is built for i486, i686, which doesn't use all
the optimizations for your CPU (unless you run gentoo and rebuild
everything).

So if you build ClamAV without any special optimization flags it should
be faster on 64-bit than 32-bit!
Of course you can get same result on 32-bit by using -march=native, but
thats not the default.

3. amd64 instruction set has more registers, and 64-bit registers
8 more registers means more efficient code, without the need to often
spill/reload from the stack when you run out of registers (as you often
do on 32-bit)
64-bit register means the compiler can more efficiently implement some
operations.

4. The amd64 calling convention passes parameters in registers by
default, and not on the stack (uses the stack only if registers are not
enough).
Which means that function call overhead is smaller.


> Adobe, and a few
> Microsoft products were the only ones that I was aware of that did.
>   

Maybe if you are thinking of windows applications, which is a completely
different matter than
FreeBSD applications.

Best regards,
--Edwin
_______________________________________________
Help us build a comprehensive ClamAV guide: visit http://wiki.clamav.net
http://www.clamav.net/support/ml

Reply via email to