From: Andy Grundman Date: Sat, 23 Feb 2008 16:15:18 +0000 (+0000) Subject: HTTP::Body 1.01, fixed regex to restore performance of urlencoded parser, the previou... X-Git-Tag: v1.01^0 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=5a1e3a8da55ba5833bca68c1a37e4b53f9d000de;hp=249dbc12509896cb171278288a5f3d54530cbd79;p=catagits%2FHTTP-Body.git HTTP::Body 1.01, fixed regex to restore performance of urlencoded parser, the previous version was about 3x slower --- diff --git a/Changes b/Changes index a9099fb..355ac08 100644 --- a/Changes +++ b/Changes @@ -1,5 +1,8 @@ This file documents the revision history for Perl extension HTTP::Body. +1.01 2008-02-23 11:30:00 + - Fixed performance issue with urlencoded regex. + 1.00 2008-02-23 11:00:00 - Added support for chunked requests if no $length value is passed to new(). - Added support for XForms submissions. (Daniel Ruoso) diff --git a/lib/HTTP/Body.pm b/lib/HTTP/Body.pm index 859e6eb..7bdd14b 100644 --- a/lib/HTTP/Body.pm +++ b/lib/HTTP/Body.pm @@ -4,7 +4,7 @@ use strict; use Carp qw[ ]; -our $VERSION = '1.00'; +our $VERSION = '1.01'; our $TYPES = { 'application/octet-stream' => 'HTTP::Body::OctetStream', diff --git a/lib/HTTP/Body/UrlEncoded.pm b/lib/HTTP/Body/UrlEncoded.pm index 671ba47..aacef3b 100644 --- a/lib/HTTP/Body/UrlEncoded.pm +++ b/lib/HTTP/Body/UrlEncoded.pm @@ -45,7 +45,7 @@ sub spin { # Note: s/// appears faster than tr/// $self->{buffer} =~ s/\+/ /g; - for my $pair ( split( /&|;(?:\s+)?/, $self->{buffer} ) ) { + for my $pair ( split( /[&;](?:\s+)?/, $self->{buffer} ) ) { my ( $name, $value ) = split( /=/, $pair , 2 );