When should I use the GCC-pip option?

In the GCC 4.1.2 documentation, this talks about the -pipe option:

-pipe

Use feeds rather than temporary files to link between the various compilation steps. This does not work on some systems where the assembler cannot read from the pipe; but the GNU builder has no problem.

I suppose I can tell from the error message if the assemblers of my systems do not support channels, therefore, except for this problem, when it matters, do I use this option? What factors should decide to use it?

+45
gcc pipe compiler-options
Oct 03 '09 at 5:55
source share
6 answers

It usually doesn't matter

He has considerations + and - . Historically, running the compiler and assembler will simultaneously emphasize RAM resources.

Gcc standards are currently small, and -pipe adds a bit of multi-core parallel access available.

Nevertheless, the processor is so fast that it can create this temporary file and read it without even noticing. And since -pipe has never been the default mode, it is sometimes activated a bit. One developer usually reports that he does not notice the time difference.

Now there are several large projects. You can check out one tree that will build all of Firefox or NetBSD, or something like that, something really big. Something that includes all of X, say, as a component of a small subsystem. You may or may not notice the difference when millions of lines of code are involved in a task in thousands and thousands of C files. As I’m sure you know, people usually work only with a small part of something like this at one time. But if you are a release engineer or working on a build server or changing something in stdio.h , you may well want to build the whole system to see if you break something. And now every drop of productivity is probably considered ...

+31
03 Oct '09 at 6:04
source share
— -

In our experience with a medium-sized project, adding -pipe did not reveal differences in build time. We encountered several problems (sometimes without deleting intermediate files if an error was detected, IIRC), and therefore, since he did not type anything, we stopped using it, and did not try to fix these problems.

+29
Jan 07 '10 at 13:26
source share

Having tried this now, it looks moderately faster to build when source / assembly destinations are in NFS (linux network). However, memory usage is great. If you never fill RAM and use an NFS source, this is like winning with -pipe.

+23
May 25 '10 at 6:21
source share

Honestly, there are very few reasons not to use it. -pipe will only use a little bar, which if this box is building code, I would assume that it has a decent amount. This can significantly improve build time if your system uses a more conservative file system that writes and deletes all temporary files along the way (e.g. ext3).

+8
Oct 03 '09 at 6:04
source share

One of the advantages is that with -pipe, the compiler interacts less with the file system. Even if it is a disk drive, the data should still go through the input / output levels of the blocks and the file system when using temporary files, while with the pipe it becomes a little more direct.

In files, the compiler must first complete the write before it can call the assembler. Another advantage of pipes is that both the compiler and assembler can work at the same time, and this slightly improves the SMP architecture. Especially when the compiler needs to wait for data from the source file (due to blocking I / O calls), the operating system gives the assembler the full processor time and allows it to complete its work faster.

+3
Mar 28 '12 at 12:13
source share

From a hardware point of view, I think you would use -pipe to save the lifetime of your hard drive.

-one
Oct 03 '09 at 9:04
source share



All Articles