Sha256: efa7e59c9fd2966bcef4674f1845bfa3d5e548134b9384fe12110aa04e0d2f15

Contents?: true

Size: 953 Bytes

Versions: 5

Compression:

Stored size: 953 Bytes

Contents

# Run as eg:
#
# $ bundle exec ruby perf/public_bench.rb

require 'benchmark/ips'
require 'faster_s3_url'
require 'aws-sdk-s3'

access_key_id =  "fakeExampleAccessKeyId"
secret_access_key = "fakeExampleSecretAccessKey"

bucket_name = "my-bucket"
object_key =  "some/directory/file.jpg"
region = "us-east-1"

aws_client = Aws::S3::Client.new(region: region, access_key_id: access_key_id, secret_access_key: secret_access_key)
aws_bucket = Aws::S3::Bucket.new(name: bucket_name, client: aws_client)

faster_s3_builder = FasterS3Url::Builder.new(region: region, access_key_id: access_key_id, secret_access_key: secret_access_key, bucket_name: bucket_name)

Benchmark.ips do |x|
  begin
    require 'kalibera'
    x.config(:stats => :bootstrap, :confidence => 95)
  rescue LoadError

  end


  x.report("aws-sdk-s3") do
    aws_bucket.object(object_key).public_url
  end

  x.report("FasterS3Url") do
    faster_s3_builder.public_url(object_key)
  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
faster_s3_url-1.2.0 perf/public_bench.rb
faster_s3_url-1.1.0 perf/public_bench.rb
faster_s3_url-1.0.0 perf/public_bench.rb
faster_s3_url-0.2.0 perf/public_bench.rb
faster_s3_url-0.1.0 perf/public_bench.rb