README.md
1# NAME
2
3HTTP::Headers::Fast - faster implementation of HTTP::Headers
4
5# SYNOPSIS
6
7 use HTTP::Headers::Fast;
8 # and, same as HTTP::Headers.
9
10# DESCRIPTION
11
12HTTP::Headers::Fast is a perl class for parsing/writing HTTP headers.
13
14The interface is same as HTTP::Headers.
15
16# WHY YET ANOTHER ONE?
17
18HTTP::Headers is a very good. But I needed a faster implementation, fast =)
19
20# ADDITIONAL METHODS
21
22- as\_string\_without\_sort
23
24 as\_string method sorts the header names.But, sorting is bit slow.
25
26 In this method, stringify the instance of HTTP::Headers::Fast without sorting.
27
28- psgi\_flatten
29
30 returns PSGI compatible arrayref of header.
31
32 my $headers:ArrayRef = $header->flatten
33
34- psgi\_flatten\_without\_sort
35
36 same as flatten but returns arrayref without sorting.
37
38# @ISA HACK
39
40If you want HTTP::Headers::Fast to pretend like it's really HTTP::Headers, you can try the following hack:
41
42 unshift @HTTP::Headers::Fast::ISA, 'HTTP::Headers';
43
44# BENCHMARK
45
46 HTTP::Headers 5.818, HTTP::Headers::Fast 0.01
47
48 -- push_header
49 Rate orig fast
50 orig 144928/s -- -20%
51 fast 181818/s 25% --
52
53 -- push_header_many
54 Rate orig fast
55 orig 74627/s -- -16%
56 fast 89286/s 20% --
57
58 -- get_date
59 Rate orig fast
60 orig 34884/s -- -14%
61 fast 40541/s 16% --
62
63 -- set_date
64 Rate orig fast
65 orig 21505/s -- -19%
66 fast 26525/s 23% --
67
68 -- scan
69 Rate orig fast
70 orig 57471/s -- -1%
71 fast 57803/s 1% --
72
73 -- get_header
74 Rate orig fast
75 orig 120337/s -- -24%
76 fast 157729/s 31% --
77
78 -- set_header
79 Rate orig fast
80 orig 79745/s -- -30%
81 fast 113766/s 43% --
82
83 -- get_content_length
84 Rate orig fast
85 orig 182482/s -- -77%
86 fast 793651/s 335% --
87
88 -- as_string
89 Rate orig fast
90 orig 23753/s -- -41%
91 fast 40161/s 69% --
92
93# AUTHOR
94
95 Tokuhiro Matsuno E<lt>tokuhirom@gmail.comE<gt>
96 Daisuke Maki
97
98And HTTP::Headers' originally written by Gisle Aas.
99
100# THANKS TO
101
102Markstos
103
104Tatsuhiko Miyagawa
105
106# SEE ALSO
107
108[HTTP::Headers](https://metacpan.org/pod/HTTP::Headers)
109
110# LICENSE
111
112This library is free software; you can redistribute it and/or modify
113it under the same terms as Perl itself.
114