bywaterstreet
Joined 6 years ago
Karma
17
Submissions
9
Member since
Oct 18
Joined 6 years ago
Hang on, this only happens on first run of the binary, right? It caches the hash afterwards? This statement is incorrect unless Apple are sending logs to the server (i.e. of every cache hit). Can somebody confirm?
I write a lot of Go on my Mac at home. The first run is _always_ slow, but I've never measured it or bothered to find out why. This is a real "lightbulb moment" for me.
I just built a Go executable and timed it: 0.194 for the first, and ~0.018 for subsequent. I haven't signed code on Mac platforms before, so I figured I'd give it a go using the Apple code signing guide [0]. So, I created a self-signed certificate using Keychain, changed and built a Go project, signed the executable [1], and ran it: ~0.400 for the first run, and ~0.018 for subsequent. It... doubled? Will this happen on every first run still? Is there a way to exclude executables?
[0] https://developer.apple.com/library/archive/documentation/Se...
[1] codesign -s <cert_id> <path>