Jump to content

Compilation Time Question

jPak

Regarding this comic

 

Given that I've only had academic programming experience, all my programs were relatively small and compiled in seconds. I'm wondering just what circumstances to require enough time for the developers to carry out a sword fight. The reason I ask is I just graduated university and I generally recompiled and tested after every new line in an effort to keep track of progress. If compilation time becomes an issue, then perhaps my methodologies must adapt.

 

Bonus question: explain some of your larger projects or any projects you're particularly proud of developing!

 

The bigger projects I worked on include a BitTorrent client and a Photo Library application which introduced us to MVC. The latter was eventually ported to Android -- which ended up being a disaster.

Link to comment
Share on other sites

Link to post
Share on other sites

In my final year project, I worked with OpenSceneGraph to develop and test a line-of-sight strategy. Very basic 3D rendering performed by OSG and computation for line-of-sight programmed ontop of the graphics layer to give me full control. I only had about 7 files of code, totalling maybe 2k or so, but with the inclusion of many library and header files from OSG itself, compilation time on a core i7 3770k was at least 3 seconds by the end, and that's just a few linked files and OSG's dev files. So I can understand why much larger-scale projects demand some compilation time. However the guy writing xkcd is probably referring to a few years ago, maybe. Or the fact that compilation in a workplace often utilises the network's central servers for compilation, which may require several time-allocations of the process to complete the job.

Link to comment
Share on other sites

Link to post
Share on other sites

Well I don't have experience with large projects, but I can tell you a few of my projects take 10 seconds to compile.  With that said, I've compiled a few open source projects before (mainly very large math libraries or emulators) and some of them took 10 minutes to compile all the pieces.

 

One other thing to remember, sometimes projects after compilation go to unit testing.  So some might consider the time to get back the unit test results as part of "compiling", as if you break a unit test the code won't get submitted to the main source

0b10111010 10101101 11110000 00001101

Link to comment
Share on other sites

Link to post
Share on other sites

My final bachelors year project was shared between two classes (Distributed Systems and Software Engineering) and so consisted of a replicated and secure mobile phone enterprise application (to keep track of customer phone balance and stuff). It was done in java and used jboss and uddi for the distribution purposes. The first half of the project was more SE: build the app logic, implement each layer, etc., all in a centralized manner. This was quick to compile. The second part involved coding the web services and separating the presentation layer from the logic and storage layers and then we had to present our solution working with 2 phone companies and about 3 replicas per phone company server. It also had a certification authority and the servers had to register themselves in the naming service. We had an ant file to compile and deploy all the servers and, by the end, compiling and deploying all the servers took about 5 minutes on a fast laptop. It isn't one of the biggest things ever but deployment, in this case, contributed to the overall slowdown on the "compilation phase". Sometimes we compiled everything, found a bug, changed a line and had to re-deploy the whole thing again!

 

And open source projects are also quite big. This semester I tried (with my colleagues) to study and fiddle with the dalvikVM (android's virtual machine) and I decided to compile an emulator with the source code. Took about 20 minutes on my, then recently purchased, i7-3770K!

Link to comment
Share on other sites

Link to post
Share on other sites

I don't have enough experience to answer it, but what I am told by experienced people, is that a well made program, even if it's big, should take seconds to compile. That is why many compilers like Visual Studio, have options to measure the compilation time process.

 

Usually long compilation time, is either you have something else that the compiler execute... like compressing textures or something, or old code, where compilation time was never looked into, touched many hands, pass through many years.. and now it's a point that it's too big to spend time to restart it... as an example, of course.

Link to comment
Share on other sites

Link to post
Share on other sites

I don't have enough experience to answer it, but what I am told by experienced people, is that a well made program, even if it's big, should take seconds to compile. That is why many compilers like Visual Studio, have options to measure the compilation time process.

 

Technically this is true because, if you have made good design choices, changing (or adding) something shouldn't require you to change the majority of files on your project. And since IDEs and tools like make only compile the files that have been changed since the last compilation and link it with the others a small change should be much faster to compile than rebuilding the whole thing. For instance after compiling dalvik, if you make a simple change in just one file, recompiling takes only 1-2 minutes instead of the initial 20 (and most of those 2 minutes is spent linking and rebuilding the .img file of the emulator).

 

However, optimizations also take a big chunk of the compilation process. If you know you have written optimized code or you are not trying to make an extremely high performance app you can just have the compiler do it's work normally, but if you have old code (or code that clearly could/should take much less time to execute) you can tell the compiler to optimize it in various levels. This, of course, takes longer because the compiler has to keep state and check the source code for possible improvements.

Link to comment
Share on other sites

Link to post
Share on other sites

However the guy writing xkcd is probably referring to a few years ago, maybe. Or the fact that compilation in a workplace often utilises the network's central servers for compilation, which may require several time-allocations of the process to complete the job.

 

This comic was about 6 years old so you may be on to something there.

 

One other thing to remember, sometimes projects after compilation go to unit testing.  So some might consider the time to get back the unit test results as part of "compiling", as if you break a unit test the code won't get submitted to the main source

 

I never really thought about it this way. That's definitely another way to look at it. Thanks!

 

...I decided to compile an emulator with the source code. Took about 20 minutes on my, then recently purchased, i7-3770K!

 

That or the Linux kernel are about as large a project I'd be comfortable compiling independently. Maybe I'll try it out on my ancient CPU and see how many days it takes :D

 

I really appreciate the input from everyone and your projects were really cool and interesting to read. Please keep them coming!

Link to comment
Share on other sites

Link to post
Share on other sites

Try compiling a Linux kernel/distro and you'll understand. :P

 

The odds that you'll ever be able to use that as an excuse for some fun swordfighting time with your colleagues are very slim, I'm afraid.

Edited by wolfsinner

Want to solve problems? Check this out.

Link to comment
Share on other sites

Link to post
Share on other sites

Well... that's an OS. It's super duper complicated, peace of software. I am sure, all Adobe fancy software is a peace of cake compared to Windows. Hence why it takes several thousands employees working on Windows continously. Th interface is like 10-20% of the entire OS.

I also know that compiling code to simulate a GPU architecture takes weeks in room of servers. So they don't compile everything, until the end. Simulation on virtual GPU also takes forever to process.

Link to comment
Share on other sites

Link to post
Share on other sites

I've tried for fun to compile a few open source projects with the hope of playing with the code. Haven't been brave enough to tinker with them though.

 

As I recall Google chrome took my machine (2600k, 8gigs ram) about 25 minutes to compile, and it brought the total memory usage to about 6 gigs. There's little else I've done that wasn't for the express purpose of eating memory that used so much ram.

 

I've also compiled firefox and codeblocks. I'm under the impression that all reasonably sized programs are probably going to have compile times in the 15-30 minute range for a high end machine.

 

I also "had to" compile Quake 3 for my raspberry pi to show it off and that took a couple of hours I believe.

 

EDIT: also, the closest I can come across for windows compile time is this stack overflow  thread:

 

    http://stackoverflow.com/questions/226377/operating-system-compile-time

 

 

Apparently windows has always taken 12 hours to build.

My rig: 2600k(4.2 GHz) w/ Cooler Master hyper 212+, Gigabyte Z68-UD3H-B3, Powercolor 7870 xt(1100/1500) w/AIO mod,

8GB DDR3 1600, 120GB Kingston HyperX 3K SSD, 1TB Seagate, Antec earthwatts 430, NZXT H2

Verified max overclock, just for kicks: http://valid.canardpc.com/show_oc.php?id=2609399

Link to comment
Share on other sites

Link to post
Share on other sites

I compiled Android (Cyanogen Mod to be specific) and it took from 4-6 hours to compile, and that's including the kernel, the JVM, and everything else in android. Rather deceptively, Mobile operating systems like Android and iOS are not as lightweight as they seem...

Link to comment
Share on other sites

Link to post
Share on other sites

I compiled Android (Cyanogen Mod to be specific) and it took from 4-6 hours to compile, and that's including the kernel, the JVM, and everything else in android. Rather deceptively, Mobile operating systems like Android and iOS are not as lightweight as they seem...

I hear ya. Mobile OSes, applications, and interfaces are designed to be a little more streamlined and not as interaction heavy so they appear to be less powerful but that's the UX that most designers go for with their implementations.

 

So I'm about to dive into my first job on Monday. I guess I'll see first hand if I can carry out compile-time battles in the office!

Link to comment
Share on other sites

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×