File: bench.t

package info (click to toggle)
libprotocol-osc-perl 0.09-1
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, bullseye, buster, forky, sid, trixie
  • size: 124 kB
  • sloc: perl: 89; makefile: 2
file content (19 lines) | stat: -rw-r--r-- 649 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
use strict; use warnings;
use Protocol::OSC;
use Net::LibLO::Message;
use Net::OpenSoundControl;
use Benchmark 'cmpthese';

my $protocol = Protocol::OSC->new;
my $data = $protocol->message(qw(/echo isf 3 laaaa 3.0));

cmpthese -1, {
    'Net::LibLO::Message' => sub { Net::LibLO::Message->new(qw(isf 3 laaaa 3.0)) },
    'Protocol::OSC' => sub { $protocol->message(qw(/echo isf 3 laaaa 3.0)) },
    'Net::OpenSoundControl' => sub { Net::OpenSoundControl::encode([qw(/echo i 3 s laaaa f 3.0)]) }
};

cmpthese -1, {
    'Protocol::OSC' => sub { $protocol->parse($data) },
    'Net::OpenSoundControl' => sub { Net::OpenSoundControl::decode($data) }
};