Is code compilation demanding?

Oct 3, 2020 at 3:29pm
I'd like to know how demanding is it to compile a simple command prompt based C++ program using gcc or g++.

What is the absolute worst machine, that could do this?

Also, are there any system requirements for code compilation (gcc/g++) or does it depend on the code?
Oct 3, 2020 at 3:34pm
Well, you type
g++ hello.cpp
into a Windows cmd window or linux shell. How demanding would you like it to be?

It saves loading the Visual Studio bloatware.



What is the absolute worst machine, that could do this?

My 'phone.
Last edited on Oct 3, 2020 at 3:36pm
Oct 3, 2020 at 3:42pm
What is the absolute worst machine, that could do this?

The resources consumed by the compiler alone depends on the code being compiled -- typically, the amount of memory is the constraining factor.

Software can be cross-compiled - compiled on one machine for another.
Oct 3, 2020 at 4:04pm
C++ was compiled already last millenia with "regular" hardware of the day. Even the phones of today have more oomph.
Oct 3, 2020 at 5:26pm
it isnt linear.
the larger the program, the more resources it takes, because the compiler will attempt to optimize across wide boundaries and that takes a great deal of resources for a big code base.

that said,
compiling a small program with g++ is not very demanding.
it can be done on little more than a simple wristwatch. It may take hours there, instead of nanoseconds on a real computer, but it can DO it. There are bored people out there who spend their free time putting unix onto oddball devices. You can google this. Any of these devices that are running the OS can compile a small program with g++.

it depends on the code, as I noted above.
Last edited on Oct 3, 2020 at 5:26pm
Oct 3, 2020 at 6:11pm
So an old Pentium 4 PC should be more than enough, right?
Oct 3, 2020 at 8:01pm
more than. I compiled on a 286 that was like a 10 HZ chip with no floating point support and there are folks older than me here too..
Last edited on Oct 3, 2020 at 8:01pm
Topic archived. No new replies allowed.