Experiencing occasional Cayenne-slowness on Sierra or High Sierra? Might want to read this.

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

Experiencing occasional Cayenne-slowness on Sierra or High Sierra? Might want to read this.

Hugi Thordarson
Hi all.
Just a quick service notification: I recently noticed my unit tests were running rather slowly, due to weird occasional 8 second breaks.

Turns out that something changed in Sierra regarding how it handles host name lookups (although weirdly enough, this was only exposed in High Sierra for me) making the invocation of java.net.InetAddress.getLocalHost() extremely slow. And Cayenne uses that method in IDUtil to get the machine's IP address for generation of random IDs.

The workaround/fix is to add the hostname of your machine to the localhost records in /etc/hosts, as specified here:

https://thoeni.io/post/macos-sierra-java/

Cheers,
- hugi