Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 18 additions & 0 deletions benchmarks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,24 @@ shipit:
#
# Other Benchmarks
#
addressable-equality:
desc: addressable URI equality comparison
addressable-getters:
desc: addressable URI component getters (scheme, host, port, path, query, fragment)
addressable-join:
desc: addressable URI joining/merging paths
addressable-merge:
desc: addressable URI merging options
addressable-new:
desc: addressable URI construction from hash
addressable-normalize:
desc: addressable URI normalization
addressable-parse:
desc: addressable URI parsing (simple and complex URIs)
addressable-setters:
desc: addressable URI component setters (scheme, host, path modification)
addressable-to-s:
desc: addressable URI to string conversion
binarytrees:
desc: binarytrees from the Computer Language Benchmarks Game.
blurhash:
Expand Down
5 changes: 5 additions & 0 deletions benchmarks/addressable-equality/Gemfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# frozen_string_literal: true

source "https://rubygems.org"

gem "addressable"
16 changes: 16 additions & 0 deletions benchmarks/addressable-equality/Gemfile.lock
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
GEM
remote: https://rubygems.org/
specs:
addressable (2.8.7)
public_suffix (>= 2.0.2, < 7.0)
public_suffix (6.0.2)

PLATFORMS
aarch64-linux
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I guess that's more of a Bundler thing/issue, but I wonder why the architecture is even included here given those are pure-Ruby gems.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

AFAIK, that is the default behavior of bundler. It always include the architecture where the gemfile was created

ruby

DEPENDENCIES
addressable

BUNDLED WITH
2.6.9
15 changes: 15 additions & 0 deletions benchmarks/addressable-equality/benchmark.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
require_relative "../../harness/loader"

Dir.chdir __dir__
use_gemfile

require "addressable/uri"

run_benchmark(100) do
10000.times do
# URI equality comparison
uri1 = Addressable::URI.parse("http://example.com")
uri2 = Addressable::URI.parse("http://example.com:80/")
uri1 == uri2
end
end
5 changes: 5 additions & 0 deletions benchmarks/addressable-getters/Gemfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# frozen_string_literal: true

source "https://rubygems.org"

gem "addressable"
16 changes: 16 additions & 0 deletions benchmarks/addressable-getters/Gemfile.lock
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
GEM
remote: https://rubygems.org/
specs:
addressable (2.8.7)
public_suffix (>= 2.0.2, < 7.0)
public_suffix (6.0.2)

PLATFORMS
aarch64-linux
ruby

DEPENDENCIES
addressable

BUNDLED WITH
2.6.9
21 changes: 21 additions & 0 deletions benchmarks/addressable-getters/benchmark.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
require_relative "../../harness/loader"

Dir.chdir __dir__
use_gemfile

require "addressable/uri"

COMPLEX_URI = "https://user:pass@example.com:8080/path/to/resource?query=value&foo=bar#fragment"

run_benchmark(100) do
10000.times do
# Component access
uri = Addressable::URI.parse(COMPLEX_URI)
uri.scheme
uri.host
uri.port
uri.path
uri.query
uri.fragment
end
end
5 changes: 5 additions & 0 deletions benchmarks/addressable-join/Gemfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# frozen_string_literal: true

source "https://rubygems.org"

gem "addressable"
16 changes: 16 additions & 0 deletions benchmarks/addressable-join/Gemfile.lock
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
GEM
remote: https://rubygems.org/
specs:
addressable (2.8.7)
public_suffix (>= 2.0.2, < 7.0)
public_suffix (6.0.2)

PLATFORMS
aarch64-linux
ruby

DEPENDENCIES
addressable

BUNDLED WITH
2.6.9
14 changes: 14 additions & 0 deletions benchmarks/addressable-join/benchmark.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
require_relative "../../harness/loader"

Dir.chdir __dir__
use_gemfile

require "addressable/uri"

run_benchmark(100) do
10000.times do
# URI joining
base = Addressable::URI.parse("http://example.com/a/b/c")
base.join("../d")
end
end
5 changes: 5 additions & 0 deletions benchmarks/addressable-merge/Gemfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# frozen_string_literal: true

source "https://rubygems.org"

gem "addressable"
16 changes: 16 additions & 0 deletions benchmarks/addressable-merge/Gemfile.lock
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
GEM
remote: https://rubygems.org/
specs:
addressable (2.8.7)
public_suffix (>= 2.0.2, < 7.0)
public_suffix (6.0.2)

PLATFORMS
aarch64-linux
ruby

DEPENDENCIES
addressable

BUNDLED WITH
2.6.9
16 changes: 16 additions & 0 deletions benchmarks/addressable-merge/benchmark.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
require_relative "../../harness/loader"

Dir.chdir __dir__
use_gemfile

require "addressable/uri"

SIMPLE_URI = "http://example.com/path"

run_benchmark(100) do
10000.times do
# URI merging
uri = Addressable::URI.parse(SIMPLE_URI)
uri.merge(scheme: "https", port: 8080)
end
end
5 changes: 5 additions & 0 deletions benchmarks/addressable-new/Gemfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# frozen_string_literal: true

source "https://rubygems.org"

gem "addressable"
16 changes: 16 additions & 0 deletions benchmarks/addressable-new/Gemfile.lock
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
GEM
remote: https://rubygems.org/
specs:
addressable (2.8.7)
public_suffix (>= 2.0.2, < 7.0)
public_suffix (6.0.2)

PLATFORMS
aarch64-linux
ruby

DEPENDENCIES
addressable

BUNDLED WITH
2.6.9
19 changes: 19 additions & 0 deletions benchmarks/addressable-new/benchmark.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
require_relative "../../harness/loader"

Dir.chdir __dir__
use_gemfile

require "addressable/uri"

run_benchmark(100) do
10000.times do
# URI construction from hash
Addressable::URI.new(
scheme: "https",
host: "example.com",
port: 443,
path: "/path",
query: "foo=bar"
)
end
end
5 changes: 5 additions & 0 deletions benchmarks/addressable-normalize/Gemfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# frozen_string_literal: true

source "https://rubygems.org"

gem "addressable"
16 changes: 16 additions & 0 deletions benchmarks/addressable-normalize/Gemfile.lock
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
GEM
remote: https://rubygems.org/
specs:
addressable (2.8.7)
public_suffix (>= 2.0.2, < 7.0)
public_suffix (6.0.2)

PLATFORMS
aarch64-linux
ruby

DEPENDENCIES
addressable

BUNDLED WITH
2.6.9
14 changes: 14 additions & 0 deletions benchmarks/addressable-normalize/benchmark.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
require_relative "../../harness/loader"

Dir.chdir __dir__
use_gemfile

require "addressable/uri"

run_benchmark(100) do
10000.times do
# URI normalization
uri = Addressable::URI.parse("HTTP://EXAMPLE.COM:80/path")
uri.normalize
end
end
5 changes: 5 additions & 0 deletions benchmarks/addressable-parse/Gemfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# frozen_string_literal: true

source "https://rubygems.org"

gem "addressable"
16 changes: 16 additions & 0 deletions benchmarks/addressable-parse/Gemfile.lock
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
GEM
remote: https://rubygems.org/
specs:
addressable (2.8.7)
public_suffix (>= 2.0.2, < 7.0)
public_suffix (6.0.2)

PLATFORMS
aarch64-linux
ruby

DEPENDENCIES
addressable

BUNDLED WITH
2.6.9
18 changes: 18 additions & 0 deletions benchmarks/addressable-parse/benchmark.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
require_relative "../../harness/loader"

Dir.chdir __dir__
use_gemfile

require "addressable/uri"

# Sample URIs for testing
SIMPLE_URI = "http://example.com/path"
COMPLEX_URI = "https://user:pass@example.com:8080/path/to/resource?query=value&foo=bar#fragment"

run_benchmark(100) do
10000.times do
# URI parsing - simple and complex
Addressable::URI.parse(SIMPLE_URI)
Addressable::URI.parse(COMPLEX_URI)
end
end
5 changes: 5 additions & 0 deletions benchmarks/addressable-setters/Gemfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# frozen_string_literal: true

source "https://rubygems.org"

gem "addressable"
16 changes: 16 additions & 0 deletions benchmarks/addressable-setters/Gemfile.lock
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
GEM
remote: https://rubygems.org/
specs:
addressable (2.8.7)
public_suffix (>= 2.0.2, < 7.0)
public_suffix (6.0.2)

PLATFORMS
aarch64-linux
ruby

DEPENDENCIES
addressable

BUNDLED WITH
2.6.9
18 changes: 18 additions & 0 deletions benchmarks/addressable-setters/benchmark.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
require_relative "../../harness/loader"

Dir.chdir __dir__
use_gemfile

require "addressable/uri"

SIMPLE_URI = "http://example.com/path"

run_benchmark(100) do
10000.times do
# Component modification
uri = Addressable::URI.parse(SIMPLE_URI)
uri.scheme = "https"
uri.host = "newhost.com"
uri.path = "/newpath"
end
end
5 changes: 5 additions & 0 deletions benchmarks/addressable-to-s/Gemfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# frozen_string_literal: true

source "https://rubygems.org"

gem "addressable"
16 changes: 16 additions & 0 deletions benchmarks/addressable-to-s/Gemfile.lock
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
GEM
remote: https://rubygems.org/
specs:
addressable (2.8.7)
public_suffix (>= 2.0.2, < 7.0)
public_suffix (6.0.2)

PLATFORMS
aarch64-linux
ruby

DEPENDENCIES
addressable

BUNDLED WITH
2.6.9
16 changes: 16 additions & 0 deletions benchmarks/addressable-to-s/benchmark.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
require_relative "../../harness/loader"

Dir.chdir __dir__
use_gemfile

require "addressable/uri"

COMPLEX_URI = "https://user:pass@example.com:8080/path/to/resource?query=value&foo=bar#fragment"

run_benchmark(100) do
10000.times do
# URI to string conversion
uri = Addressable::URI.parse(COMPLEX_URI)
uri.to_s
end
end
Loading