Live data from Hacker News

How fast does Java compile?

mill-build.org

71–76 of 76 posts

Re: How fast does Java compile?

#71

Earlier quoted context omitted.

No, that is not what compiled means. A compiler is simply a program that translates from one language to another. Hence a compiled language is one that is translated into a different language prior to execution. Java is compiled twice; once to byte code and again to machine code by the JIT compiler. That is unless you compile it directly to machine code using, say, Graal Native Image. You are welcome to your opinion…

As having a masters in computer science I respectfully disagree with you. Would you consider a program that translates C code to FORTRAN a compiler? Nope, it's a translator. A compiler compiles a language into a direct executable. Just like Microsoft Windows has executables, .exe file, there's no runtime required to run those files.

I very much consider RATFOR a compiler.

Re: How fast does Java compile?

#72
> Again, Maven doesn’t make it easy to show the classpath used to call javac ourselves.

Wait, I was under the impression that maven dependency plugin has a command for exactly that (dependency:build-classpath or something like that)?

Re: How fast does Java compile?

#73

Earlier quoted context omitted.

Hundreds of thousands of lines per minute isn't the same as 32,000 LOC per second . Delphi did some things that made it unusually fast to parse, like being single pass (meant you could not arrange your code as you saw fit as backreferences didn't work). Also, javac suffers from being JIT compiled so a lot of CPU is wasted each time it's invoked unless you use daemons like Gradle does. But also, the Delphi compiler wa…

> meant you could not arrange your code as you saw fit as backreferences didn't work The actual consequence is that you had to declare things at the beginning of the block. It handled forward declarations just fine. This had minimal impacts on actually "arranging your code."

No, it also didn't handle circular dependencies between interface blocks. Big pain.

Re: How fast does Java compile?

#74
post #59

Earlier quoted context omitted.

Hundreds of thousands of lines per minute isn't the same as 32,000 LOC per second . Delphi did some things that made it unusually fast to parse, like being single pass (meant you could not arrange your code as you saw fit as backreferences didn't work). Also, javac suffers from being JIT compiled so a lot of CPU is wasted each time it's invoked unless you use daemons like Gradle does. But also, the Delphi compiler wa…

> You could make javac much faster just by compiling it with GraalVM Would it be faster? To start up, sure, but I'd imagine the compiler to rate quite well on the scale of how much it benefits from the dynamic runtime optimizations that are only possible with jit compilation.

GraalVM AOT can utilize profiling data from training runs to give the same speedups. It also does ML driven inference of profiles.

Re: How fast does Java compile?

#75

Earlier quoted context omitted.

Hundreds of thousands of lines per minute isn't the same as 32,000 LOC per second . Delphi did some things that made it unusually fast to parse, like being single pass (meant you could not arrange your code as you saw fit as backreferences didn't work). Also, javac suffers from being JIT compiled so a lot of CPU is wasted each time it's invoked unless you use daemons like Gradle does. But also, the Delphi compiler wa…

> Hundreds of thousands of lines per minute isn't the same as 32,000 LOC per second. Right, this is an example of the Java speed being terrible because Borland was almost as good thirty years ago. 32,000 lines per second is 100,000 lines per three seconds, 2 million lines per minute. Compare the statistic that wasn't thirty years old: > “ Delphi 2 can compile large .pas files at 1.2M lines per second. ”

[deleted]

Re: How fast does Java compile?

#76

Earlier quoted context omitted.

> meant you could not arrange your code as you saw fit as backreferences didn't work The actual consequence is that you had to declare things at the beginning of the block. It handled forward declarations just fine. This had minimal impacts on actually "arranging your code."

No, it also didn't handle circular dependencies between interface blocks. Big pain.

I never had that be a problem in practice because the interface was separate from implementation. It was exceptionally easy to sort that rare corner case out.
Post reply on HN