gitaly-hooks spends 90% of its time initializing aws-sdk-go
The gitaly-hooks binary is spending 90% of its time initializing global variables in the aws-sdk-go dependency:
The root cause is huge maps in the SDK which cause us to assemble the Go maps at first, and gitaly-hooks is a short-lived executable that's executed really often. The fun thing is: we don't even need aws-sdk-go as a dependency.
We may have to revisit how we build binaries such that they don't pull in unnecessary dependencies. This is a huge concern, and especially slows down the reference-transaction hook which is executed on every mutating RPC call.