Speed efficiency of Perl Modules for ~ 1MB HTTP fetching This paper will show the efficiency of Perl Modules for fetching 552K of data, from a WebService, with different ways.

The data is the result of a MySQL Query which take 0.03s to execute, which raw output takes 552KB with 37971 rows of this format:
LoginServer ID
lkajsdlj7
qlkqweiuu14
lkqwe12
......

SOAP
use SOAP::Lite;

my $soap_server = "http://soap.example.com/soap.php";
my $soap = SOAP::Lite->new(proxy => $soap_server, autoresult => 1);

my $data = $soap->fetch_all_infos();
This takes 19.6s to execute.

JSON + LWP::UserAgent
use LWP::UserAgent;
use JSON;

my $body = LWP::UserAgent->new()->get($url)->content;

$body = decode_json($body);
This take 2.1s to execute.

JSON + LWP::UserAgent with custom callback
use LWP::UserAgent;
use JSON;

sub cb()
{
    my ($chunk, $response, $protocol) = @_;

#    print "LEN : ".length($chunk)."\n";
     $response->add_content($chunk);
}

my $ua = LWP::UserAgent->new;
my $response = $ua->get($url,
                        ":content_cb" => \&cb,
                     OR ":content_cb" => sub { $_[1]->add_content($_[0]); },
                        ":read_size_hint" => 2**20
    );
die unless $response->is_success;
my $body = decode_json($response->content);
This take 1.3s to execute.