# make optimization



## rysic (Apr 12, 2012)

I have an old Compaq NC6000 with Pentium M inside. Because of its age I want to optimize FreeBSD as much as possible. Please tell me how much can give me changing make.conf file (insert CPU) and compile everything using ports? Can inserting CPU model to make.conf cause any problems?


----------



## SirDice (Apr 12, 2012)

rysic said:
			
		

> Can inserting CPU model to make.conf cause any problems?


It can. But if you want to set anything CPUTYPE is the only thing you should set. Do NOT muck about with CFLAGS unless you fully understand the consequences.


----------



## rysic (Apr 12, 2012)

SirDice said:
			
		

> It can.


What exactly?



			
				SirDice said:
			
		

> It can. But if you want to set anything CPUTYPE is the only thing you should set. Do NOT muck about with CFLAGS unless you fully understand the consequences.


Yes I read about that so I'll try to use 
	
	



```
CPUTYPE=pentium-m
```

Did you try it? Is there a big difference? How can I check if make is using any optimization?


----------



## SirDice (Apr 12, 2012)

rysic said:
			
		

> Did you try it?


Yes.



> Is there big difference?


No.

You need to realize the build system already has the most optimal options. There isn't much to gain unless you start fiddling with things. And even then the speed increase is marginal plus you add the risk of instability.

Best thing to do is to leave things as they are. You can tweak the kernel a bit by removing any debug options and options/devices that aren't used.


----------



## rysic (Apr 12, 2012)

OK! So I'll use packages. Compilation takes extre*me*ly much time and if profit is not bit. About which options do you write in kernel?


----------



## mobilitysd (Nov 25, 2012)

Here is a short explanation how you can make optimization by make.conf


----------



## wblock@ (Nov 25, 2012)

Please don't follow that.  Setting CFLAGS or COPTFLAGS often causes problems, and can prevent actual optimizations used by some ports.  Setting CPUTYPE is about the only safe optimization to make in /etc/make.conf.


----------



## UNIXgod (Nov 25, 2012)

this:

http://gcc.gnu.org/onlinedocs/gcc-4.2.1/gcc/Optimize-Options.html

oh. and don't do it. I had a pentium-m many moons ago. using pipe and 02 are fine. Other stuff breaks it. Just set the processor type and your good to go.


----------

