bmcentee148
bmcentee148

Reputation: 604

Why is javac slowest on a fresh system reboot?

So, I've always noticed something but haven't given it much thought until now. When I first turn on my system, I might compile a small java program in .9 seconds using javac Dummy.java. But if I make small changes and then recompile the program, or go to compile a program of similar length and complexity, it might take .6 seconds. The exact numbers aren't important; Whats important is that it takes a significant amount of time less to compile after I've already compiled something on that boot. Its as if javac needs to "warm up" or something. I develop on both my desktop PC and Macbook Air and the same situation arises on both so I'm guessing its got something to do with javac itself. My question is why\how does this happen? ...Or am I crazy?

Upvotes: 0

Views: 33

Answers (1)

Elliott Frisch
Elliott Frisch

Reputation: 201439

The operating system (and disk) cache need to read the compiler and perform dynamic linking (reading and loading the libraries that java uses). One (or more) caches are likely to be playing a factor into the runtime of the java compiler (and every other program) on your system.

Upvotes: 1

Related Questions