pico_http_parser 0.0.1 → 0.0.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +18 -1
- data/benchmark/bench_helper.rb +1 -1
- data/benchmark/{benchmark.pl → benchmark.rb} +16 -14
- data/lib/pico_http_parser/version.rb +1 -1
- data/pico_http_parser.gemspec +2 -2
- metadata +5 -5
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 77d9ce494785aca207b88dd3bdc5340d94cac9ad
|
4
|
+
data.tar.gz: 9ee980d7dd5d1c5f5c2467603dffc0444513fb71
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 7fb958f767c35d5d71234f729ad74e346685329072122b612766787ff000e4ff21c2d12b42b5e73f6096ed63682f570b56fb7ae9f1defed42b8c1fb87d9935d5
|
7
|
+
data.tar.gz: 7dfa7423fda76a94ea59df99a0e6d15b59ba61620d3e4575269508a1a3411de1e064bb0b0d99bd7d03f2e95f02e65eb0c45783cbf8c24ac570f8f3ae3d118cf7
|
data/README.md
CHANGED
@@ -49,6 +49,23 @@ given request is corrupt
|
|
49
49
|
|
50
50
|
given request is incomplete
|
51
51
|
|
52
|
+
## Benchmark
|
53
|
+
|
54
|
+
On my Macbook Air
|
55
|
+
|
56
|
+
```
|
57
|
+
Calculating -------------------------------------
|
58
|
+
PicoHTTPParser 13.988k i/100ms
|
59
|
+
Unicorn's HttpParser 12.250k i/100ms
|
60
|
+
-------------------------------------------------
|
61
|
+
PicoHTTPParser 160.563k (± 4.3%) i/s - 811.304k
|
62
|
+
Unicorn's HttpParser 135.976k (± 4.1%) i/s - 686.000k
|
63
|
+
|
64
|
+
Comparison:
|
65
|
+
PicoHTTPParser: 160562.7 i/s
|
66
|
+
Unicorn's HttpParser: 135975.8 i/s - 1.18x slower
|
67
|
+
```
|
68
|
+
|
52
69
|
## SEE ALSO
|
53
70
|
|
54
71
|
PicoHTTPParser is created based on Perl's HTTP::Parser::XS.
|
@@ -61,7 +78,7 @@ https://github.com/h2o/picohttpparser
|
|
61
78
|
|
62
79
|
## Contributing
|
63
80
|
|
64
|
-
1. Fork it ( https://github.com/
|
81
|
+
1. Fork it ( https://github.com/kazeburo/pico_http_parser/fork )
|
65
82
|
2. Create your feature branch (`git checkout -b my-new-feature`)
|
66
83
|
3. Commit your changes (`git commit -am 'Add some feature'`)
|
67
84
|
4. Push to the branch (`git push origin my-new-feature`)
|
data/benchmark/bench_helper.rb
CHANGED
@@ -12,24 +12,26 @@ loop = 300000
|
|
12
12
|
|
13
13
|
#File.read(File.expand_path(File.dirname(__FILE__) + '/sample_request.http'))
|
14
14
|
|
15
|
-
Benchmark.
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
15
|
+
Benchmark.ips do |x|
|
16
|
+
x.time = 5
|
17
|
+
x.warmup = 2
|
18
|
+
|
19
|
+
x.report("PicoHTTPParser") {
|
20
|
+
env = {}
|
21
|
+
PicoHTTPParser.parse_http_request(request_body,env)
|
22
|
+
}
|
23
|
+
|
22
24
|
begin
|
23
25
|
require 'unicorn'
|
24
26
|
include Unicorn
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
end
|
31
|
-
end
|
27
|
+
x.report("Unicorn's HttpParser") {
|
28
|
+
parser = HttpParser.new
|
29
|
+
parser.buf << request_body
|
30
|
+
parser.parse
|
31
|
+
}
|
32
32
|
rescue LoadError
|
33
33
|
puts("Can't benchmark unicorn as it couldn't be loaded.")
|
34
34
|
end
|
35
|
+
|
36
|
+
x.compare!
|
35
37
|
end
|
data/pico_http_parser.gemspec
CHANGED
@@ -8,8 +8,8 @@ Gem::Specification.new do |spec|
|
|
8
8
|
spec.version = PicoHTTPParser::VERSION
|
9
9
|
spec.authors = ["Masahiro Nagano"]
|
10
10
|
spec.email = ["kazeburo@gmail.com"]
|
11
|
-
spec.summary = %q{Fast HTTP parser using
|
12
|
-
spec.description = %q{Fast HTTP parser using
|
11
|
+
spec.summary = %q{Fast HTTP parser using picohttpparser}
|
12
|
+
spec.description = %q{Fast HTTP parser using picohttpparser}
|
13
13
|
spec.homepage = "https://github.com/kazeburo/pico_http_parser"
|
14
14
|
spec.license = "Artistic"
|
15
15
|
spec.extensions = %w[ext/pico_http_parser/extconf.rb]
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: pico_http_parser
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Masahiro Nagano
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-11-
|
11
|
+
date: 2014-11-21 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -52,7 +52,7 @@ dependencies:
|
|
52
52
|
- - "~>"
|
53
53
|
- !ruby/object:Gem::Version
|
54
54
|
version: '3'
|
55
|
-
description: Fast HTTP parser using
|
55
|
+
description: Fast HTTP parser using picohttpparser
|
56
56
|
email:
|
57
57
|
- kazeburo@gmail.com
|
58
58
|
executables: []
|
@@ -68,7 +68,7 @@ files:
|
|
68
68
|
- README.md
|
69
69
|
- Rakefile
|
70
70
|
- benchmark/bench_helper.rb
|
71
|
-
- benchmark/benchmark.
|
71
|
+
- benchmark/benchmark.rb
|
72
72
|
- ext/pico_http_parser/extconf.rb
|
73
73
|
- ext/pico_http_parser/pico_http_parser.c
|
74
74
|
- ext/pico_http_parser/picohttpparser/.gitattributes
|
@@ -109,7 +109,7 @@ rubyforge_project:
|
|
109
109
|
rubygems_version: 2.2.2
|
110
110
|
signing_key:
|
111
111
|
specification_version: 4
|
112
|
-
summary: Fast HTTP parser using
|
112
|
+
summary: Fast HTTP parser using picohttpparser
|
113
113
|
test_files:
|
114
114
|
- spec/01_simple_spec.rb
|
115
115
|
- spec/02_too_much_spec.rb
|