Experiencing occasional Cayenne-slowness on Sierra or High Sierra? Might want to read this.
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: