# ports  vs pkg_add



## bsduser35325 (Oct 18, 2010)

Is there any noticeable speed difference using ports to make clean installs oppose to pkg_add?


----------



## Galactic_Dominator (Oct 18, 2010)

http://www.freebsd.org/doc/handbook/ports-overview.html


----------



## graudeejs (Oct 18, 2010)

Is it faster to take jet plane or to walk by foot from one side of Europe to another?


----------



## da1 (Oct 18, 2010)

It's definitely faster to walk ).

Packages are designed to be faster, smaller, require less time to install/start. They are suited for a machine with limited resources.


----------



## phoenix (Oct 18, 2010)

I believe the OP is asking whether or not a custom compiled port will *run* faster than a generic binary package.

Not asking about which is faster to install, since it's obvious that uncompressing/extracting a binary package will be faster.

As to the original question, it all depends.  Compiling from the ports tree, you can include only the features that you want, and you can enable more compiler optimisations, and compile a binary specifically for the CPU in your system.  For some programs (video encoders, for example) this can make a huge difference.  For other programs (office suites, for example) you'd be hard pressed to notice a difference.


----------



## ahavatar (Oct 18, 2010)

I'm following 8-STABLE, and I have no other choice but ports because 8-STABLE has usually no amd64 binaries available for updates.


----------



## olav (Oct 18, 2010)

My guess is that the precompiled packages are compiled with GCC 4.2. If you have a new CPU, some software might benefit a lot if you compile with GCC 4.5.


----------



## phoenix (Oct 18, 2010)

ahavatar said:
			
		

> I'm following 8-STABLE, and I have no other choice but ports because 8-STABLE has usually no amd64 binaries available for updates.



Yes there are:
ftp://ftp.freebsd.org/pub/FreeBSD/ports/amd64/packages-8-stable/Latest/


----------



## ahavatar (Oct 18, 2010)

phoenix said:
			
		

> Yes there are:
> ftp://ftp.freebsd.org/pub/FreeBSD/ports/amd64/packages-8-stable/Latest/



Hmm... why then "portupgrade -P" almost always compiles for me? x(

Is there some delay between a port update and the binary package ?


----------



## phoenix (Oct 19, 2010)

The ports tree is continuously updated, with many updates every day.

The package building cluster runs almost continuously, building packages for all architectures.  HOWEVER, it builds based on a snapshot of the ports tree, and will always lag behind the versions available in the ports tree.  Sometimes by up to a month or three.

IOW, binary packages will always be behind in versions compared to the ports tree.

Either live with the occasional port compile using -P, or don't worry about running the absolute latest versions of apps and use -PP and only upgrade when there are binary packages available.


----------



## PacketMan (Feb 11, 2016)

phoenix said:


> The package building cluster runs almost continuously, building packages for all architectures.  HOWEVER, it builds based on a snapshot of the ports tree, and will always lag behind the versions available in the ports tree.  Sometimes by up to a month or three.
> 
> IOW, binary packages will always be behind in versions compared to the ports tree.



Is this still true? By up to three months?  Gee, we should work with the folks at BOINC to build a package building distributed cluster.  I'd donate a bunch of CPU to help.


----------



## sidetone (Feb 11, 2016)

For www/firefox, the port build was noticeably faster than the package, when the dependencies were more complicated or with a slower computer. It still makes a difference, and it is true for heavily dependent ports. I like using packages mainly for build-only dependencies and simpler programs, because it doesn't seem to interfere with features, and it doesn't noticeably slow down the system.


----------



## SirDice (Feb 11, 2016)

PacketMan said:


> Is this still true? By up to three months?  Gee, we should work with the folks at BOINC to build a package building distributed cluster.  I'd donate a bunch of CPU to help.


Not any more, as far as I know packages are built on a weekly basis.


----------

