clj-aws-s3 icon indicating copy to clipboard operation
clj-aws-s3 copied to clipboard

Add type annotations to avoid reflection

Open chaptastic opened this issue 11 years ago • 3 comments

I did some profiling of our app with Yourkit and found that we were spending a great deal of time doing reflection on some of the S3 api methods. It seems that the type tag on s3-client wasn't having any effect. I added type annotations at each call to s3-client in order to avoid this.

Now warn-on-reflection doesn't report anything from aws.sdk.s3 and we don't see reflection calls as a hot spot in our app anymore.

chaptastic avatar Jan 10 '14 14:01 chaptastic

Rather than adding tags everywhere, I think it might be better to understand why tagging the s3-client var doesn't work in the first place.

weavejester avatar Jan 10 '14 14:01 weavejester

Also, which Clojure version are you using?

weavejester avatar Jan 10 '14 14:01 weavejester

I agree that's probably a better solution. I will poke around some more and try to get to the bottom of it. The tag is definitely in the metadata on s3-client but doesn't seem to be having an effect.

I'm using 1.5.1.

chaptastic avatar Jan 10 '14 14:01 chaptastic