In "Programming in scala" book by Martin Odersky, it explained the reason why scalac
seems slow (page 114):
The reason is that every time the compiler starts up, it spends time scanning the contents of jar files and doing other initial work before it even looks at the fresh source files you submit to it.
What is the compilation benefit from scanning jar files everytime any compilation is started? Indeed, if most of developers use FSC (Fast Scala compiler) to avoid this default behavior, why haven't scala's authors removed these scans?
Why doesn't javac
behave similarly?
It is probably because scalac
simply calls a class in a .jar
file. My guess is that they do not want to create temporary (or cache) files.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With