jrochkind / faster_s3_url

Optimized generation of public and presigned AWS S3 GET URLs in ruby faster
MIT License
84 stars 7 forks source link

reduce object allocations slightly #6

Closed jrochkind closed 10 months ago

jrochkind commented 10 months ago

Quite likely not enough to matter, but following trails from https://github.com/sciencehistory/scihist_digicoll/issues/2449

jrochkind commented 10 months ago

existing benchmarks before and after this change

before

$ bundle exec ruby perf/public_bench.rb Warming up -------------------------------------- aws-sdk-s3 5.035k i/100ms FasterS3Url 84.596k i/100ms Calculating ------------------------------------- aws-sdk-s3 49.488k (± 2.5%) i/s - 241.680k in 5.045709s FasterS3Url 839.483k (± 0.5%) i/s - 4.230M in 5.040198s with 95.0% confidence

after

bundle exec ruby perf/public_bench.rb Warming up -------------------------------------- aws-sdk-s3 5.042k i/100ms FasterS3Url 83.854k i/100ms Calculating ------------------------------------- aws-sdk-s3 50.331k (± 0.4%) i/s - 252.100k in 5.009916s FasterS3Url 845.442k (± 0.4%) i/s - 4.277M in 5.059813s with 95.0% confidence

conclusion

Either it made no difference or maybe very slightly improved speed of execution.