structurizr / cli

A command line utility for Structurizr.
https://docs.structurizr.com/cli
Apache License 2.0
491 stars 75 forks source link

structurizr-cli takes 10 seconds to start #14

Closed kirkj closed 3 years ago

kirkj commented 3 years ago

Hi,

I just wanted to check if this is a 'just my machine' thing, or to be expected.

The CLI (v1.4.5) and the latest release build (v1.5.0) both take 10 seconds to get to the point of printing Structurizr CLI v1.5.0, even if no command line arguments are given.

I know it's Java, and so I don't have an expectation that it will run immediately, but I just thought I should reach out and see if that's expected, or if you have a hint on how to debug why that might be the case.

Cheers,

Kirk

simonbrowndotje commented 3 years ago

I just downloaded a fresh, separate copy of v1.5.0 and it's only 1-2 seconds for me (Java 13 on macOS Catalina).

kirkj commented 3 years ago

Ok, cool - it's a "me" thing then... I'll close the issue. Cheers!

kirkj commented 3 years ago

Just in case anyone is interested... it appears that it is something to do with how my wifi connection is configured. Using a different wireless access point makes a dramatic difference. I think something in the java classloading sequence doesn't like the way ipv6 is set up on my network:

"${JAVA_HOME}/bin/java" -Xlog:class+load:file=classload.txt -jar $SCRIPT_DIR/structurizr-cli-1.5.0.jar "$@"

Here's the 5 second delay in the classload log file:

[1.243s][info][class,load] java.net.Inet6Address source: shared objects file
[1.244s][info][class,load] java.net.Inet6Address$Inet6AddressHolder source: shared objects file
[6.248s][info][class,load] sun.net.InetAddressCachePolicy source: jrt:/java.base
[6.248s][info][class,load] sun.net.InetAddressCachePolicy$1 source: jrt:/java.base

Cheers,

Kirk

simonbrowndotje commented 3 years ago

If you're on a Mac, there is/has been an outage that's causing a delay to starting apps -> https://twitter.com/lapcatsoftware/status/1326990296412991489 ... that might also be related.

kirkj commented 3 years ago

Ugh... this was the cause. Sorry for assuming it was your app, and not my computer!

http://justthesam.com/2016/10/fixing-java-net-inet6addressimpl-lookupallhostaddr-slowdown/