LWP::UserAgent::parse_headerのベンチマーク

titleタグとか勝手にparseするやつね


結果

% perl parse_header.pl
            Rate        lwp lwp-header
lwp        543/s         --       -19%
lwp-header 673/s        24%         --

script

use Benchmark;
use LWP::UserAgent;

my $count = 3000;

Benchmark::cmpthese( $count , {
    'lwp' => sub {
        my $ua = LWP::UserAgent->new;
        my $res = $ua->get('http://localhost/')
    },
    'lwp-header' => sub {
        my $ua = LWP::UserAgent->new;
        $ua->parse_head(0);
        my $res = $ua->get('http://localhost/');
    },
});

created by blog.nomadscafe.jp

コメント

コメントはありません

コメントを投稿

コメントを投稿するにはログインが必要です