Jump to content
Excelsior Forums
David

Compilation taking multiple hours - how to speed up?

Recommended Posts

Looking for any suggestions on how to speed up project compilation, or how to compile jars individually and then link.

The project isn't that big - around 30 library jars, then my main application jar. Total of around 14,500 classes. But this took over 2 hours to compile using the 64-bit compiler (on a reasonably modern Core i7 machine, with 8 GB of RAM). The 32-bit compiler didn't even manage it - it was still chugging along ~12 hours later when I left it overnight.

I don't NEED a 64-bit final executable - my application would be fine as a 32-bit app. But it looks like that's a non-starter at the moment.

So --

1)  Are multiple-hour compile times normal and expected for a project of this size?

2)  Is there any way of splitting compilation up into smaller units? E.g., can I compile the library jars separately into object files that are kept on disk, then just compile my application sources and link when I change my main application?

3)  Are there any compiler options that I should be looking at to try and speed things up?

 

Thanks.

Share this post


Link to post
Share on other sites

Found a really simple solution - use a ramdisk :-)

I put a process monitor on the compiler as it was running, and it seems to be spending most of time on IO - I would have attached a picture of the procmon trace, but for some reason the forum isn't letting me upload any pictures. Basically the compiler appears to open, write to, and close sym.pdb, bod.pdb and rdf.pdb (plus others) over and over again. Each open and close results in an IO flush.

On my conventional spinning-rust hard disk this results in a huge overhead just waiting for lots and lots of tiny synchronous IO operations to complete.

So I created a small ramdisk, put the project files on there, and tried compiling... and instead of compilation taking hours or days, it now only takes minutes. Unbelievably quick compared to before -- compiling the whole project now takes around ~10 minutes.

Share this post


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

×