HTTP::Headers::Fast3pm
Faster implementation of http::headers
Usage
use HTTP::Headers::Fast;# and, same as HTTP::Headers.
Overview
HTTP::Headers::Fast is a perl class for parsing/writing HTTP headers.
The interface is same as HTTP::Headers.
Why yet another one?
HTTP::Headers is a very good. But I needed a faster implementation, fast =)
Additional methods
- as_string_without_sort
-
as_string method sorts the header names.But, sorting is bit slow.
In this method, stringify the instance of HTTP::Headers::Fast without sorting.
- psgi_flatten
-
returns PSGI compatible arrayref of header.
my $headers:ArrayRef = $header->flatten
- psgi_flatten_without_sort
-
same as flatten but returns arrayref without sorting.
@isa hack
If you want HTTP::Headers::Fast to pretend like it's really HTTP::Headers, you can try the following hack:
unshift @HTTP::Headers::Fast::ISA, 'HTTP::Headers';
Benchmark
HTTP::Headers 5.818, HTTP::Headers::Fast 0.01-- push_headerRate orig fastorig 144928/s -- -20%fast 181818/s 25% ---- push_header_manyRate orig fastorig 74627/s -- -16%fast 89286/s 20% ---- get_dateRate orig fastorig 34884/s -- -14%fast 40541/s 16% ---- set_dateRate orig fastorig 21505/s -- -19%fast 26525/s 23% ---- scanRate orig fastorig 57471/s -- -1%fast 57803/s 1% ---- get_headerRate orig fastorig 120337/s -- -24%fast 157729/s 31% ---- set_headerRate orig fastorig 79745/s -- -30%fast 113766/s 43% ---- get_content_lengthRate orig fastorig 182482/s -- -77%fast 793651/s 335% ---- as_stringRate orig fastorig 23753/s -- -41%fast 40161/s 69% --
Thanks to
Markstos
Tatsuhiko Miyagawa
Releases
5 releases since Debian 9 (Stretch); the text changed 3 times.