yegor256/s3auth — pull request #146 by carlosmiranda (2014-04-15 02:12:15+00:00)
Title: Issue #144 Cached AmazonS3Client and AmazonCloudWatchClient instances

For `AmazonS3Client`, the instances are cached per domain, while for `AmazonCloudWatchClient`, there is one holder of a cacheable instance for the entire application.

Previously, a new `AmazonS3Client` would be created when `DefaultBucket.client()` was called, and a new `AmazonCloudWatchClient` was created when `DefaultHost` was constructed. Creating new instances of these objects caused a SSL handshake to occur, which caused a disproportionately large amount of CPU utilization.

I also removed the `config.setProtocol(Protocol.HTTP)` calls under the presumption that they were put in as a workaround to the excessive `SSLContext.getDefault()` CPU usage.