com-lihaoyi / mill

Mill is a fast JVM build tool that supports Java and Scala. 2-4x faster than Gradle and 4-10x faster than Maven for common workflows, Mill aims to make your project’s build process performant, maintainable, and flexible
https://mill-build.org/
MIT License
2.22k stars 356 forks source link

Optimize startup time using TCP sockets instead of junixsocket and `tput` instead of jline #4009

Open lihaoyi opened 14 hours ago

lihaoyi commented 14 hours ago

The AFUNIXServerSocket library we are using seems to cause an extra ~500ms latency launching the Mill client, and also causes the Graal native-image to crash during generation.

jline.terminal.Terminal.getSize also adds a few hundred milliseconds, so we instead use the same tput command that Ammonite uses which takes <10ms.

Together these two changes cuts down the time taken for a hot time ./mill version on the Mill repo from ~1.05s to ~0.24s