native interface: access specific parts of request
Hello
This patch gives access to specific parts of feersum connection/request: method uri path query content_length remote_address remote_port headers input. Thus gives performance boost in some scenarios.
Serving native handler via unix-socket behind nginx:
sub ($r) {
my ($method, $path) = ($r->method, $r->path);
$r->send_response(200, [qw'content-type text/plain'], ["$method:$path"]);
}
is ~15% faster than psgi handler
sub ($env) {
my ($method, $path) = @$env{uc'request_method', uc'path_info'};
[200, [qw'content-type text/plain'], ["$method:$path"]]
}
p.s. there is no performance penalty comparing to current version p.p.s. tested under linux, gcc 10, perl-5.34.0, perl-5.8.9
Hi! Thank you for the contribution. Sorry for the late reply, but I currently do not have the capacity to review & merge this pull request.
If @stash can chime in that would be great, otherwise we may have to wait until someone volunteers time to assume maintainership.