Java-Gaming.org
Play Revenge of the Titans! The situation is critical. We need fancy commanders to defend Earth, the moon, Mars!
Featured games (78)
games approved by the League of Dukes
Games in Showcase (406)
games submitted by our members
Games in WIP (293)
games currently in development
News: Read the Java Gaming Resources, or peek at the official Java tutorials
 
    Home     Help   Search   Login   Register   
Pages: [1]
  ignore  |  Print  
  Threaded javac?  (Read 2070 times)
0 Members and 1 Guest are viewing this topic.
Offline Abuse

JGO Coder


Medals: 2


falling into the abyss of reality


« Posted 2010-09-09 00:45:00 »

I've never really thought about it before now, but as I recently purchased a 6-core Phenom II it dawned on me that javac is making almost no use of these extra resources.

This seems rather archaic, and not at all in-keeping with "a platform that has been designed from the ground up to support concurrent programming."

I wonder - what do enterprise customers do? Do multi-threaded Java compilers exist?
Surely large code bases & multi-core processors are at the heart of their business - it'd be extraordinary if they have been lumbered with this limitation for so long & done nothing about it?!

A few Googles have turned up some investigation into the issue back in 2008, but it looks like the work was abandoned for one reason or another.
This lack of interest seems very odd to me, as from my rudamentary understanding compilation appears to be eminently suitable for distribution across any number of cores, or for that matter across distributed networks.

This liability is obviously only going to get worse with the inevitable growth of parallel computing, and the subsequent larger, more complex programs that take advantage of these resources.
Are the powers that be simply too afraid to rewrite the compiler for fear of introducing bugs?

Make Elite IV:Dangerous happen! Pledge your backing at KICKSTARTER here!
Offline Orangy Tang

JGO Kernel


Medals: 48
Projects: 11


Monkey for a head


« Reply #1 - Posted 2010-09-09 01:20:20 »

I wonder if most people just don't care - compilation in java is lightning quick anyway (doubly so in Eclipse when it's doing it in the background as you type, I assume Netbeans has something similar).

In environments with multithreaded compilation it seems to be a side effect of having to compile the whole binary in one go - with java you can just divide your classes up arbitrarily and spin up multiple versions of javac. Hell, most C/C++ environments still only link in a single thread and that can take minutes - many times more than a complete java compile.

[ TriangularPixels.com - Play Growth Spurt, Rescue Squad and Snowman Village ] [ Rebirth - game resource library ]
Online Riven
« League of Dukes »

JGO Overlord


Medals: 438
Projects: 4


Hand over your head.


« Reply #2 - Posted 2010-09-09 07:51:47 »

In Eclipse, compile-times are often in the range of 0.1 second. If I do a full rebuild of all my projects, it takes 5 seconds. I have to admit that I run my workspace off of a ram-disk, so the bottleneck 'for everybody else' is probably disk I/O, which is known to seriously degrade on multi-thread access.

Hi, appreciate more people! Σ ♥ = ¾
Learn how to award medals... and work your way up the social rankings
Projects: Revenge of the Titans, Titan Attacks, Droid Assault, and Ultratron
Games published by our own members! Check 'em out!
Play the free demo of Revenge of the Titans!
Offline princec
« League of Dukes »

JGO Kernel


Medals: 196
Projects: 3


Eh? Who? What? ... Me?


« Reply #3 - Posted 2010-09-09 13:40:32 »

I switched to a solid state disk with my workspace on. Everything speeded up by roughly a factor of 5.

Cas Smiley

Offline elias4444

Junior Member





« Reply #4 - Posted 2010-09-09 16:37:04 »

Quote
I switched to a solid state disk with my workspace on. Everything speeded up by roughly a factor of 5.
Dang I've got to get me one of those! I just wish the prices were a bit lower.

Online Riven
« League of Dukes »

JGO Overlord


Medals: 438
Projects: 4


Hand over your head.


« Reply #5 - Posted 2010-09-09 17:00:09 »

With a RAM disk, you get ~25x speed increase.

I make a backup every hour to be safe.

Hi, appreciate more people! Σ ♥ = ¾
Learn how to award medals... and work your way up the social rankings
Projects: Revenge of the Titans, Titan Attacks, Droid Assault, and Ultratron
Offline princec
« League of Dukes »

JGO Kernel


Medals: 196
Projects: 3


Eh? Who? What? ... Me?


« Reply #6 - Posted 2010-09-09 17:12:34 »

I find that the worry of a crash prevents me from even considering a ram disk Smiley One that shadow copied to a real disk, though... now that'd work.

Cas Smiley

Offline dime

Senior Newbie





« Reply #7 - Posted 2010-09-10 08:43:53 »


SSDs are pretty fast and pretty darn safe.
I have one at home and it Eclipse flies compared to what I have at work (even though work has better CPU and more memory).
Online Riven
« League of Dukes »

JGO Overlord


Medals: 438
Projects: 4


Hand over your head.


« Reply #8 - Posted 2010-09-10 08:45:17 »

SSDs are pretty fast and pretty darn safe.

RAM disk != SSD

Hi, appreciate more people! Σ ♥ = ¾
Learn how to award medals... and work your way up the social rankings
Projects: Revenge of the Titans, Titan Attacks, Droid Assault, and Ultratron
Online Roquen

JGO Ninja


Medals: 66



« Reply #9 - Posted 2010-09-10 09:23:36 »

What? People actually use javac?

Seriously: Eclipse spawns multiple threads to compile.  I'd be amazed if NetBeans doesn't as well.  The trick with parallel compiling is that you either need to know the complete dependency chains (DC) in advance or have a bunch of "glue" logic for thread communication to deal with these dependencies.   Eclipse handles the problem by knowing the DC in advance.  You can do the same via the old-school UNIX makesystems by have a "make depends" build the DC and then invoke make to work in parallel (typically with 1-2x processes per core).  The downside of this method is that is launching processes for each unique chain (at best..assuming your dependency generator is doing a good job).  "javac" is easy to hack, so you could create a version which uses (say) an external DC file and builds everything that is out-of-date.  My guess is that you'd see, at best, a 2x improvement over using something like eclipse. Creating the programs needed and switching between your editor and shell will probably end up eat much more time than you'd save.

@OrangeTang: For many modern "C/C++" compilers, the "link" stage now includes global optimizations and that's why it sometimes takes awhile.  Java compiles very fast mostly because it perform the equivalent of a "debug" build.
Games published by our own members! Check 'em out!
Try the Free Demo of Droid Assault
Offline markus.borbely

Junior Member





« Reply #10 - Posted 2010-09-11 22:43:19 »

We have hudson to compile, test and package for us so I almost never see javac. Of course, I have to test it locally, but it's not the building that takes time. It's restarting the application server that takes time.
I used to work with IBM websphere commerce, it took 5 minutes to start (I'm not kidding).
Offline DzzD
« Reply #11 - Posted 2010-09-11 23:46:04 »

really never experienced any javac time problem, I just did a try to rebuild all projects I am working on right now and they all tooks less than 5 seconds to compile ( on a really medium mobile computer ) : thoses projects size  range from 70 to 400 classes for the bigger one (using JCreator)

anyway as mentioned above multithreading compilation may be very hard due to unknow dependency before compilation, no ?


Pages: [1]
  ignore  |  Print  
 
 
You cannot reply to this message, because it is very, very old.

Play Revenge of the Titans! The situation is critical. We need fancy commanders to defend Earth, the moon, Mars!
 
Try the Free Demo of Revenge of the Titans

Add your game by posting it in the WIP section,
or publish it in Showcase.

The first screenshot will be displayed as a thumbnail.

The invasion has landed! On Mars! And you're there to beat 'em!
cubemaster21 (67 views)
2013-05-17 21:29:12

alaslipknot (76 views)
2013-05-16 21:24:48

gouessej (109 views)
2013-05-16 00:53:38

gouessej (104 views)
2013-05-16 00:17:58

theagentd (115 views)
2013-05-15 15:01:13

theagentd (104 views)
2013-05-15 15:00:54

StreetDoggy (149 views)
2013-05-14 15:56:26

kutucuk (172 views)
2013-05-12 17:10:36

kutucuk (170 views)
2013-05-12 15:36:09

UnluckyDevil (179 views)
2013-05-12 05:09:57
Complex number cookbook
by Roquen
2013-04-24 12:47:31

2D Dynamic Lighting
by Oskuro
2013-04-17 16:46:12

2D Dynamic Lighting
by Oskuro
2013-04-17 16:45:57

2D Dynamic Lighting
by Oskuro
2013-04-17 16:23:20

Noise (bandpassed white)
by Roquen
2013-04-05 17:36:01

Noise (bandpassed white)
by Roquen
2013-04-03 16:17:38

Java Data structures
by Roquen
2013-03-29 13:21:12

Topic Request
by kutucuk
2013-03-22 21:42:01
Powered by MySQL Powered by PHP Powered by SMF 1.1.18 | SMF © 2013, Simple Machines | Managed by Enhanced Four Valid XHTML 1.0! Valid CSS!
Page created in 0.141 seconds with 21 queries.