Sha256: 52d5299bbe8887cd674dce933373707e919d0f9d86b3b23073dbb67fe60bad79

Contents?: true

Size: 687 Bytes

Versions: 23

Compression:

Stored size: 687 Bytes

Contents

#!/usr/bin/env ruby
$:.unshift File.dirname(__FILE__) + "/../lib"
require "rubygems"
require "http/parser"
require "benchmark/ips"

request = <<-REQUEST
GET / HTTP/1.1
Host: www.example.com
Connection: keep-alive
User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_7_3) AppleWebKit/535.11 (KHTML, like Gecko) Chrome/17.0.963.78 S
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8
Accept-Encoding: gzip,deflate,sdch
Accept-Language: en-US,en;q=0.8
Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.3

REQUEST
request.gsub!(/\n/m, "\r\n")

Benchmark.ips do |ips|
  ips.report("instance") { Http::Parser.new }
  ips.report("parsing")  { Http::Parser.new << request }
end

Version data entries

23 entries across 23 versions & 8 rubygems

Version Path
fluent-plugin-nuopenlineage-light-0.1.0 vendor/bundle/ruby/3.3.0/gems/http_parser.rb-0.8.0/bench/standalone.rb
fluent-plugin-openlineage-light-0.1.4 vendor/bundle/ruby/3.3.0/gems/http_parser.rb-0.8.0/bench/standalone.rb
fluent-plugin-openlineage-light-0.1.3 vendor/bundle/ruby/3.3.0/gems/http_parser.rb-0.8.0/bench/standalone.rb
fluent-plugin-openlineage-0.1.0 vendor/bundle/ruby/3.3.0/gems/http_parser.rb-0.8.0/bench/standalone.rb
fluent-plugin-google-cloud-logging-on-prem-0.1.0 vendor/ruby/3.1.0/gems/http_parser.rb-0.8.0/bench/standalone.rb
http_parser.rb-0.8.0 bench/standalone.rb
http_parser.rb-0.7.0 bench/standalone.rb
midori_http_parser-0.6.2 bench/standalone.rb
fluent-plugin-detect-memb-exceptions-0.0.2 vendor/bundle/ruby/2.0.0/gems/http_parser.rb-0.6.0/bench/standalone.rb
fluent-plugin-detect-memb-exceptions-0.0.1 vendor/bundle/ruby/2.0.0/gems/http_parser.rb-0.6.0/bench/standalone.rb
midori_http_parser-0.6.1.3 bench/standalone.rb
midori_http_parser-0.6.1.3-java bench/standalone.rb
midori_http_parser-0.6.1.2-java bench/standalone.rb
midori_http_parser-0.6.1.2 bench/standalone.rb
midori_http_parser-0.6.1.1-java bench/standalone.rb
midori_http_parser-0.6.1.1 bench/standalone.rb
midori_http_parser-0.6.1 bench/standalone.rb
http_parser.rb-0.6.0-java bench/standalone.rb
http_parser.rb-0.6.0 bench/standalone.rb
http_parser.rb-0.6.0.beta.2-java bench/standalone.rb