-
-
Notifications
You must be signed in to change notification settings - Fork 371
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Optimize startup time using TCP sockets instead of junixsocket and `t…
…put` instead of jline (#4009) 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. * Using TCP sockets seems to cut the launch overhead down from ~1000ms to ~500ms, and opens up the possibility of using native-image to cut it further. * Using localhost TCP sockets seems secure as far as I can tell https://security.stackexchange.com/questions/108544/once-established-are-sockets-on-localhost-secure * The JVM also ships with `UnixDomainSocketAddress` starting from JDK 17 that we can consider using, either by requiring JDK17 or by conditionally using it based on JDK version. But for now I want to keep supporting JDK11 and don't want to split the code paths, so we'll hold off on this for now `jline.terminal.Terminal.getSize` also adds a few hundred milliseconds, so we instead use the same `tput` command that Ammonite uses which takes <10ms. * On windows where `tput` isn't support, it falls back to 100 cols, which I reduced it down from 120 to hopefully avoid line wrapping in most terminals while still providing a decent experience 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
- Loading branch information
Showing
10 changed files
with
53 additions
and
49 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters