How long does it take...
- To install a specific module?
- To install the ISO?
- To recompile all my modules?
These questions get asked a lot by new lunar users and it is a very logical question: Lunar is after all a source distro and requires you to compile all the applications from source, which can sometimes take extremely long!
- System(CPU) speed
Double the CPU MHz, and you double the amount of instructions that a system can make per time unit. So, as a rule, a faster CPU results in faster compiles.
- Memory size
Compiling may require large amounts of memory, especially when compiling C++ applications. Generally, a compilation will go 50% faster if you have double the memory. So, if you only have 128MB of memory, you will speed up your compiles by 225% by increasing the amount of memory to 512MB. This might be worth the trip to the hardware store.
- Idle time
Compiling takes a long time. Every second that your system is doing something else, especially interactive tasks, reduces the amount of time that your system can compile applications.
- System architecture and components
Needless to say that a compile on a SATA hard disk is a lot faster than on a ATA-33 system. Especially with larger modules this is a very important factor.
Some basic numbers
The following numbers are from a Pentium 4 laptop system with 256 MB, running at 1.8GHz. This is a fairly normal system and if you wish to compare it with your own system, you should keep in mind that this system might be relatively slower or faster based on the influencing factors mentioned earlier.
The modules listed below are very common modules, so they should give you some good insight in how long it takes to compile and install something. Based on the size you can make rough estimates for new modules that you wish to install.
module source size installed size compile time gcc 27.6 257.3 120:45 XOrg 48.2 93.8 68:07 glibc 13.5 64.7 47:09 gtk+-2 11.8 34.5 26:08 perl 9.8 52.3 17:50
As you clearly can see there is some correlation between installed size and compile time, but there are many outliers in this trend: gtk+-2 comes with a lot of bitmaps and documentation, while the XOrg tarball is counted without documentation. The gcc compiler itself has a very elaborate bootstrap phase that takes almost half the time it takes to compile the target compiler. Many many module-specific factors are at work here.
Estimating compile time
If you correlate the size of the installed product or the source code size (in compressed form easily available), you get a very loose correlation shown in the graph below:
Above is correlated by install size (uncompressed size in kB against compile time in seconds), below is correlated against the size of the compressed source code tarballs (same scale).
As you can see there is a faint correlation possible. Most applications install about 10kB of product in 1 second. The other way around you can reason that it takes 1 second to compile 10kB of (compressed) source code. This allows you to pre-estimate the compile time, assuming that your system is the same speed as my reference system.
We can do some more elaborate math on this and calculate the "index" for all modules. The index of a module would be easily calculated by the amount of time it took for lunar to compile and install 10kB of compressed source code. So we divide the total compile/install time (seconds) by the number of kilobytes that the compressed source package was:
gcc took 8025 to compile + install 26952 compressed kB of source code == 3.35 XOrg took 4087 to compile + install 47656 compressed kB of source code == 11.6
If we do this for all modules we end up with the average index of about 27, which means that on average, lunar compiles and installs 27kB of compressed source code per second. Since the size of my /var/spool/lunar is about 1.4gB, it would take me about 51851 seconds to compile and install all of this source code files. That's about 14.5 hours!