

Ask HN: What do you do during compilation? - chaghalibaghali

I'm currently working on a project that takes ~3 minutes to compile. Slightly too long to stare into space, but if I start reading an article then I invariably lose focus on the work I'm doing. Does anyone have any good solutions to this problem?
======
jameswyse
Can you add hooks to your compile process?

Write a program or script during those 3 minute breaks, just keep the project
open in another window and switch to it whenever you're compiling, write a few
lines and then go back to your work.

The program could query the YouTube API for short videos {duration: 'short'},
make a playlist sorted by popularity, remove the videos you've already seen
and then auto-play them in an overlay/lightbox on your screen. The playlist
should continue until the compile has finished, when it will notify you and
return you to your work after the current video has ended. It would also need
some way to return you to your work immediately if you don't want to watch (a
key and mouse click), or perhaps a way to stop the script from launching in
the first place.

And definitely open source it ;)

~~~
chaghalibaghali
This is a great idea! Something to focus on for <= the amount of time the
compile will take, without any opportunity to head off down a distractions
rabbit hole.

------
arkitaip
3 minutes for each compile quickly adds up. What measures have to taken to
optimize the compile time? See

[http://www.codinghorror.com/blog/2008/12/hardware-is-
cheap-p...](http://www.codinghorror.com/blog/2008/12/hardware-is-cheap-
programmers-are-expensive.html)

[http://stackoverflow.com/questions/1539347/what-are-ways-
of-...](http://stackoverflow.com/questions/1539347/what-are-ways-of-improving-
build-compile-time)

[http://stackoverflow.com/questions/1073384/what-
strategies-h...](http://stackoverflow.com/questions/1073384/what-strategies-
have-you-used-to-improve-build-times-on-large-projects)

------
tqc
How much can you do without compiling? One of my current projects involves a
painfully slow SharePoint system. Actually building and deploying takes
forever, but most pieces of code that I need quick feedback on can be built
outside the main project then integrated later, which is much easier.

When I do need a full build, I make sure it is a single step run from the
command line so I can go get a coffee while it runs.

Sure, actually speeding up the build would be better, but sometimes that isn't
an option.

------
jlemoine
Start to think how you can reduce your build time, there is a lot of
approaches to reduce compilation time depending of your programming language
and your environment.

I have seen huge compilation time improvement on C++ projects using different
tips :

\- use SSD to reduce link time

\- distributed compilation on several hosts

\- reduce amount of template to avoid world recompilation at each change

\- ...

------
logn
Start drinking lots of water.

But you could also spend every three minutes to try to speed up the build.
Dependencies, compiling unchanged source, tests, etc. There are so many ways
to speed this up. If that's not possible, maybe you can step back and think of
something more creative.

------
kristianp
What language are you using? There can be different strategies for different
languages to speed up things.

------
devonbarrett
Press ups work well for me - although, might not work so well in some office
environments.

------
Kaizo
<http://xkcd.com/303/>

------
gee_totes
xoki.com

