Inside me are two wolves.

One wants to tune my system to be as power friendly as possible.

The other wants to enable the profile guided optimization use-flags, O3 gcc setting in portage's make, and link time optimization.

The third cannot count.

@efi Okay, so I am running gentoo. One of the premises of the OS is that you can customize it more than just about any other distro.
The way it operates is that installing a package downloads the source code and compiles it. You can enable to disable features when installing using something called "use flags". If something is enabled, then that feature gets compiled into the program.

@efi The package manage is called "portage". You can give it options to pass to the compiler. Usually you pass O2, which is a great compromise between compile time performance and run time. O3 has more optimizations, but can break things, and might not always be faster.
Profile guided optimization compiles the program, then uses runtime data to recompile a faster binary, which doubles compilation time.

@efi Link time optimization is similar, except it looks for optimizations when linking libraries together. I understand this one less, but it is still an option.

Anyway, doing all three is commonly agreed to be a Bad Idea because of the instability, but in theory you can make things go zooooom.

And since I am the type of nerd who uses gentoo, the temptation is there.

Finally, wolves are a type of animal in the canis genus, and good unless you are a kitten. :P

@TakeV I like wolves and interpreters
I know when racket compiles a program it basically flattens the dependency tree so accessing properties from deeply nested library links has no extra cost, but that's all I know
I have made like six TIS-100 programs and concluded that the only low-level thing I can understand is bitwise ops

@TakeV and I am so glad I do not need to know the details to compile programs (for linux)

@efi There is this game you might be interested in checking out. It is called "Turing Complete", and the premise is that you build a computer from first principles, starting with NAND gates.
I learned so much about how computers and everything work from it, and it is amazing.

@TakeV I tried many times to figure out constructor, the Zachtronics flash game where you build logic gates on a breadboard simulator and my brain got fried after the first capacitor
linking nands is something I do not have the brainpower for, even if I know the principles

@efi That is fair. I think I appreciated the abstraction of this particular version, since you do not need to worry about voltage or components, and once you build a new component, you can reuse it without needing to recreate anything from scratch.

@TakeV @efi LTO delays the compiler's optimizations until the point when the .o files are linked into an executable; normally each .o is optimized separately and they communicate similarly to how the main executable communicates with libraries. LTO has no effect on dynamic libraries.

@TakeV @efi The main downside is the .o files have to contain toolchain-specific intermediate representations (e.g. LLVM bitcode), so you can't, e.g., compile with clang and link with GNU ld if you want LTO.

@alilly @efi Oh yeah. I have not yet messed with clang. There is an option for using it on gentoo, but I have been waiting for a few bugs to be worked out before moving over to it. The faster compile time has my interest.

Sign in to participate in the conversation

Chitter is a social network fostering a friendly, inclusive, and incredibly soft community.