# Which version of freebsd is faster: amd64 or i386?



## nikitastepanov (Feb 16, 2020)

Which version of freebsd is faster: amd64 or i386?


----------



## SirDice (Feb 17, 2020)

Neither.


----------



## PMc (Feb 19, 2020)

I'd say, the cpu registers should handle 64bit like 32bit in a single cycle, but then, as 64bit binaries are notably bigger, there is over all more space used and more i/o performed, so amd64 should be slightly slower. But no idea if that would be measurable.


----------



## ralphbsz (Feb 19, 2020)

It depends. And for most people, the speed itself makes no difference. The availability of a larger address space makes a much larger address space. For example, under i386 the machine is de-facto restricted to 3GiB memory that is going to be used (might be 4, don't remember the details). With a modern 16gig machine, under amd64 you can use a lot more memory, and just using it as file system buffer cache will make the machine significantly faster.

If you really care, there are plenty of benchmarks around, and ultimately the only benchmark that matters is your own workload. Unless you do that, I would definitely go with amd64, as it is used by a lot more people, and therefore better debugged, tested and supported.


----------



## `Orum (Feb 19, 2020)

PMc said:


> I'd say, the cpu registers should handle 64bit like 32bit in a single cycle, but then, as 64bit binaries are notably bigger, there is over all more space used and more i/o performed, so amd64 should be slightly slower. But no idea if that would be measurable.


Yes, but there are other features of AMD64 (such as double the register count) that can make it faster, not to mention the vastly larger addressable RAM.

The reality is that all modern, commercial, and fast CPUs (supercomputers/integrated aside) are going to be AMD64 these days.  And although they're backwards compatible with i386, there's no reason to use that if you don't have to.

This is especially important if you use ZFS, as ZFS make _very_ liberal use of 64 bit integers, and really benefits from lots of RAM.


----------



## kpedersen (Feb 19, 2020)

A similar discussion was here:









						Amd64 faster than i386?
					

Amd64 faster than i386?




					forums.freebsd.org
				






`Orum said:


> Yes, but there are other features of AMD64 (such as double the register count) that can make it faster, not to mention the vastly larger addressable RAM.



The increased register count could contribute to faster amd64 but the larger addressable RAM requires larger pointer sizes which are potentially slower to pass around.

I cannot seem to find a decent benchmark; there is too much biased misinformation online.

The comparison would not really be between i386 and amd64 however, it would be between i686 and amd64. However you would probably need to compile up a i686 build of FreeBSD yourself.


----------



## `Orum (Feb 19, 2020)

By the same OP, it seems.  Maybe he didn't get the answer he was looking for the first time, so he decided to try again?

If you have to ask the question, install amd64, and don't worry about it.  If you really are that concerned with peak performance, you probably would try both (as well as other OSes) with your particular workload instead of soliciting opinions on forums.


----------



## zader (Feb 19, 2020)

unless your really digging in to the weeds .. there are really only 2 questions that come to mind....
#1 - is there a hardware limitation that requires 32 or 64 bit?
#2 - does the application use-case require more than 3.3(ish) gigs of ram per thread... 

some examples of where 32bit fails.. 
music editing with tons of ram hungry plugins 
someone already mentioned zfs .. but yes!
any service that may extract/scan or execute large files such as a virus scaner
any sort of buffering where its set to more than 3.3G  (ie plex with a 6G buffer)

in cases like this .. the 32bit os will have no choice to page out to disk .. aka your huge perfomance hit. 

as for the literal squishing of 1/0's .. I belive they are exactly the same.


----------



## Paul Floyd (Feb 19, 2020)

Whilst it is possible to mix instructions from both worlds, I'll just compare 'pure' x86/x87 and amd64/SSE.

If your data fits in the 32bit address space and you have many heap allocated objects (and therefore many pointers) then x86 will be faster. In particular, better cache hit rates for the pointers can make a significant difference. I've seen this with sparse matrices, which can be implemented with a 2D linked list.

If your data doesn't fit, then you have no choice but use amd64. On amd64, having 2x the number of CPUs is a bit gain for function calls (which tend to pass by register rather than on the stack|). amd64 also tends to be faster for numerical calculation. That said, despite the whacky architecture, x87 is no slouch.


----------



## mark_j (Feb 19, 2020)

kpedersen said:


> A similar discussion was here:
> 
> 
> 
> ...



That is neglible at best and certainly offset by a large margin by the wider data path of a 64 bit cpu to its ram


----------

