| 1 | #!/usr/bin/env perl | ||||||||||||||||||||||||||||||||||||||
| 2 | 5 | ▶ | use v5.36; | ||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||
| 3 | 5 | ▶ | use strict; | ||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||
| 4 | 5 | ▶ | use warnings; | ||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||
| 5 | |||||||||||||||||||||||||||||||||||||||
| 6 | 5 | ▶ | use Getopt::Long qw(GetOptions); | ||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||
| 7 | 5 | ▶ | use IO::Socket::INET; | ||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||
| 8 | 5 | ▶ | use JSON::PP; | ||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||
| 9 | 5 | ▶ | use Socket qw(AF_UNIX SOCK_STREAM PF_UNSPEC); | ||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||
| 10 | 5 | ▶ | use Time::HiRes qw(clock_gettime CLOCK_MONOTONIC CLOCK_PROCESS_CPUTIME_ID); | ||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||
| 11 | |||||||||||||||||||||||||||||||||||||||
| 12 | 5 | ▶ | use Linux::Event; | ||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||
| 13 | 5 | ▶ | use Linux::Event::Loop; | ||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||
| 14 | 5 | ▶ | use Linux::Event::IO::Sock::Stream; | ||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||
| 15 | |||||||||||||||||||||||||||||||||||||||
| 16 | 6 | my $messages = 200_000; | |||||||||||||||||||||||||||||||||||||
| 17 | 6 | my $bytes = 64; | |||||||||||||||||||||||||||||||||||||
| 18 | 6 | my $read_size = 4_096; | |||||||||||||||||||||||||||||||||||||
| 19 | 6 | my @raw_batch_bytes = (0, 16_384, 65_536, 262_144); | |||||||||||||||||||||||||||||||||||||
| 20 | 6 | my @message_batch_sizes = (0, 1, 4, 16, 64, 256); | |||||||||||||||||||||||||||||||||||||
| 21 | 6 | my @transports = qw(unix tcp); | |||||||||||||||||||||||||||||||||||||
| 22 | 5 | my $warmup = 1; | |||||||||||||||||||||||||||||||||||||
| 23 | 5 | my $repeats = 5; | |||||||||||||||||||||||||||||||||||||
| 24 | 5 | my $json_path; | |||||||||||||||||||||||||||||||||||||
| 25 | my $help; | ||||||||||||||||||||||||||||||||||||||
| 26 | |||||||||||||||||||||||||||||||||||||||
| 27 | GetOptions( | ||||||||||||||||||||||||||||||||||||||
| 28 | 'messages=i' => \$messages, | ||||||||||||||||||||||||||||||||||||||
| 29 | 'bytes=i' => \$bytes, | ||||||||||||||||||||||||||||||||||||||
| 30 | 'read-size=i' => \$read_size, | ||||||||||||||||||||||||||||||||||||||
| 31 | 5 | ▶ | 'raw-batch-bytes=s' => sub { | ||||||||||||||||||||||||||||||||||||
|
Subroutine
__ANON__: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||
| 32 | 5 | @raw_batch_bytes = map { 0 + $_ } split /,/, $_[1]; | |||||||||||||||||||||||||||||||||||||
| 33 | }, | ||||||||||||||||||||||||||||||||||||||
| 34 | 5 | ▶ | 'message-batch-sizes=s' => sub { | ||||||||||||||||||||||||||||||||||||
|
Subroutine
__ANON__: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||
| 35 | 5 | @message_batch_sizes = map { 0 + $_ } split /,/, $_[1]; | |||||||||||||||||||||||||||||||||||||
| 36 | }, | ||||||||||||||||||||||||||||||||||||||
| 37 | 5 | ▶ | 'transports=s' => sub { @transports = split /,/, $_[1] }, | ||||||||||||||||||||||||||||||||||||
|
Subroutine
__ANON__: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||
| 38 | 5 | ▶ | 'warmup=i' => \$warmup, | ||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||
| 39 | 'repeats=i' => \$repeats, | ||||||||||||||||||||||||||||||||||||||
| 40 | 'json=s' => \$json_path, | ||||||||||||||||||||||||||||||||||||||
| 41 | 'help' => \$help, | ||||||||||||||||||||||||||||||||||||||
| 42 | ) or usage(1); | ||||||||||||||||||||||||||||||||||||||
| 43 | 5 | ▶ | usage(0) if $help; | ||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||
| 44 | |||||||||||||||||||||||||||||||||||||||
| 45 | 5 | ▶ | die "messages must be positive\n" if $messages < 1; | ||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||
| 46 | 5 | ▶ | die "bytes must be positive\n" if $bytes < 1; | ||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||
| 47 | 5 | ▶ | die "read-size must be positive\n" if $read_size < 1; | ||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||
| 48 | 5 | ▶ | die "warmup must be non-negative\n" if $warmup < 0; | ||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||
| 49 | 5 | ▶ | die "repeats must be positive\n" if $repeats < 1; | ||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||
| 50 | die "raw batch byte limits must be non-negative\n" | ||||||||||||||||||||||||||||||||||||||
| 51 | 5 | ▶ | if grep { $_ < 0 } @raw_batch_bytes; | ||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||
| 52 | die "message batch sizes must be non-negative\n" | ||||||||||||||||||||||||||||||||||||||
| 53 | 5 | ▶ | if grep { $_ < 0 } @message_batch_sizes; | ||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||
| 54 | 5 | my %valid_transport = map { $_ => 1 } qw(unix tcp); | |||||||||||||||||||||||||||||||||||||
| 55 | 5 | ▶ | die "unknown transport\n" if grep { !$valid_transport{$_} } @transports; | ||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||
| 56 | |||||||||||||||||||||||||||||||||||||||
| 57 | 5 | my @cases; | |||||||||||||||||||||||||||||||||||||
| 58 | 5 | for my $transport (@transports) { | |||||||||||||||||||||||||||||||||||||
| 59 | push @cases, map { | ||||||||||||||||||||||||||||||||||||||
| 60 | 5 | +{ mode => 'raw', transport => $transport, batch => $_ } | |||||||||||||||||||||||||||||||||||||
| 61 | } @raw_batch_bytes; | ||||||||||||||||||||||||||||||||||||||
| 62 | push @cases, map { | ||||||||||||||||||||||||||||||||||||||
| 63 | 5 | +{ mode => 'framed', transport => $transport, batch => $_ } | |||||||||||||||||||||||||||||||||||||
| 64 | } @message_batch_sizes; | ||||||||||||||||||||||||||||||||||||||
| 65 | } | ||||||||||||||||||||||||||||||||||||||
| 66 | |||||||||||||||||||||||||||||||||||||||
| 67 | 5 | for my $case (@cases) { | |||||||||||||||||||||||||||||||||||||
| 68 | 20 | run_case($case) for 1 .. $warmup; | |||||||||||||||||||||||||||||||||||||
| 69 | } | ||||||||||||||||||||||||||||||||||||||
| 70 | |||||||||||||||||||||||||||||||||||||||
| 71 | 5 | my @raw; | |||||||||||||||||||||||||||||||||||||
| 72 | 5 | for my $repeat (1 .. $repeats) { | |||||||||||||||||||||||||||||||||||||
| 73 | 5 | my @ordered = rotate_cases(\@cases, $repeat - 1); | |||||||||||||||||||||||||||||||||||||
| 74 | 5 | for my $case (@ordered) { | |||||||||||||||||||||||||||||||||||||
| 75 | 14 | my $row = run_case($case); | |||||||||||||||||||||||||||||||||||||
| 76 | 10 | $row->{repeat} = $repeat; | |||||||||||||||||||||||||||||||||||||
| 77 | 10 | push @raw, $row; | |||||||||||||||||||||||||||||||||||||
| 78 | printf "%s/%s batch=%d repeat=%d %.1f MiB/s %.3f cpu us/MiB callbacks=%d\n", | ||||||||||||||||||||||||||||||||||||||
| 79 | $case->{transport}, $case->{mode}, $case->{batch}, $repeat, | ||||||||||||||||||||||||||||||||||||||
| 80 | $row->{payload_mib_per_second}, $row->{cpu_us_per_mib}, | ||||||||||||||||||||||||||||||||||||||
| 81 | 10 | $row->{callback_calls}; | |||||||||||||||||||||||||||||||||||||
| 82 | } | ||||||||||||||||||||||||||||||||||||||
| 83 | } | ||||||||||||||||||||||||||||||||||||||
| 84 | |||||||||||||||||||||||||||||||||||||||
| 85 | 1 | my @summary; | |||||||||||||||||||||||||||||||||||||
| 86 | 1 | for my $case (@cases) { | |||||||||||||||||||||||||||||||||||||
| 87 | my @rows = grep { | ||||||||||||||||||||||||||||||||||||||
| 88 | 4 | $_->{transport} eq $case->{transport} | |||||||||||||||||||||||||||||||||||||
| 89 | && $_->{mode} eq $case->{mode} | ||||||||||||||||||||||||||||||||||||||
| 90 | && $_->{batch} == $case->{batch} | ||||||||||||||||||||||||||||||||||||||
| 91 | 16 | ▶ | } @raw; | ||||||||||||||||||||||||||||||||||||
|
Condition83%5/6
$_->{'transport'} eq $case->{'transport'} && $_->{'mode'} eq $case->{'mode'} && $_->{'batch'} == $case->{'batch'}
$_->{"transport"} eq $case->{"transport"} and $_->{"mode"} eq $case->{"mode"}
MC/DC66%2/3
$_->{'transport'} eq $case->{'transport'} && $_->{'mode'} eq $case->{'mode'} && $_->{'batch'} == $case->{'batch'}
$_->{"transport"} eq $case->{"transport"}
$_->{"mode"} eq $case->{"mode"}
$_->{'batch'} == $case->{'batch'}
Truth table75%3/4
A and B && C
A= $_->{"transport"} eq $case->{"transport"}B= $_->{"mode"} eq $case->{"mode"}C= $_->{'batch'} == $case->{'batch'}
| |||||||||||||||||||||||||||||||||||||||
| 92 | push @summary, { | ||||||||||||||||||||||||||||||||||||||
| 93 | %$case, | ||||||||||||||||||||||||||||||||||||||
| 94 | median_payload_mib_per_second => median( | ||||||||||||||||||||||||||||||||||||||
| 95 | 4 | map { $_->{payload_mib_per_second} } @rows, | |||||||||||||||||||||||||||||||||||||
| 96 | ), | ||||||||||||||||||||||||||||||||||||||
| 97 | median_messages_per_second => median( | ||||||||||||||||||||||||||||||||||||||
| 98 | 4 | map { $_->{messages_per_second} } @rows, | |||||||||||||||||||||||||||||||||||||
| 99 | ), | ||||||||||||||||||||||||||||||||||||||
| 100 | 4 | median_cpu_us_per_mib => median(map { $_->{cpu_us_per_mib} } @rows), | |||||||||||||||||||||||||||||||||||||
| 101 | 4 | median_callback_calls => median(map { $_->{callback_calls} } @rows), | |||||||||||||||||||||||||||||||||||||
| 102 | 4 | median_read_calls => median(map { $_->{read_calls} } @rows), | |||||||||||||||||||||||||||||||||||||
| 103 | 4 | median_peak_batch => median(map { $_->{peak_batch} } @rows), | |||||||||||||||||||||||||||||||||||||
| 104 | }; | ||||||||||||||||||||||||||||||||||||||
| 105 | } | ||||||||||||||||||||||||||||||||||||||
| 106 | |||||||||||||||||||||||||||||||||||||||
| 107 | 1 | for my $row (@summary) { | |||||||||||||||||||||||||||||||||||||
| 108 | my ($base) = grep { | ||||||||||||||||||||||||||||||||||||||
| 109 | 4 | $_->{transport} eq $row->{transport} | |||||||||||||||||||||||||||||||||||||
| 110 | && $_->{mode} eq $row->{mode} | ||||||||||||||||||||||||||||||||||||||
| 111 | 16 | ▶ | && $_->{batch} == 0 | ||||||||||||||||||||||||||||||||||||
|
Condition83%5/6
$_->{'transport'} eq $row->{'transport'} && $_->{'mode'} eq $row->{'mode'} && $_->{'batch'} == 0
$_->{"transport"} eq $row->{"transport"} and $_->{"mode"} eq $row->{"mode"}
MC/DC66%2/3
$_->{'transport'} eq $row->{'transport'} && $_->{'mode'} eq $row->{'mode'} && $_->{'batch'} == 0
$_->{"transport"} eq $row->{"transport"}
$_->{"mode"} eq $row->{"mode"}
$_->{'batch'} == 0
Truth table75%3/4
A and B && C
A= $_->{"transport"} eq $row->{"transport"}B= $_->{"mode"} eq $row->{"mode"}C= $_->{'batch'} == 0
| |||||||||||||||||||||||||||||||||||||||
| 112 | } @summary; | ||||||||||||||||||||||||||||||||||||||
| 113 | 4 | ▶ | next if !$base; | ||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||
| 114 | $row->{throughput_change_percent} = $base->{median_payload_mib_per_second} | ||||||||||||||||||||||||||||||||||||||
| 115 | ? 100 * ($row->{median_payload_mib_per_second} | ||||||||||||||||||||||||||||||||||||||
| 116 | 4 | ▶ | / $base->{median_payload_mib_per_second} - 1) | ||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||
| 117 | : 0; | ||||||||||||||||||||||||||||||||||||||
| 118 | $row->{callback_reduction_percent} = $base->{median_callback_calls} | ||||||||||||||||||||||||||||||||||||||
| 119 | ? 100 * (1 - $row->{median_callback_calls} | ||||||||||||||||||||||||||||||||||||||
| 120 | / $base->{median_callback_calls}) | ||||||||||||||||||||||||||||||||||||||
| 121 | 4 | ▶ | : 0; | ||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||
| 122 | } | ||||||||||||||||||||||||||||||||||||||
| 123 | |||||||||||||||||||||||||||||||||||||||
| 124 | 1 | say "\nCallback batching microbenchmark"; | |||||||||||||||||||||||||||||||||||||
| 125 | 1 | printf "messages=%d payload=%d read_size=%d warmup=%d repeats=%d\n", | |||||||||||||||||||||||||||||||||||||
| 126 | $messages, $bytes, $read_size, $warmup, $repeats; | ||||||||||||||||||||||||||||||||||||||
| 127 | 1 | printf "%-6s %-7s %10s %12s %11s %11s %12s %10s\n", | |||||||||||||||||||||||||||||||||||||
| 128 | 'xport', 'mode', 'batch', 'MiB/s', 'change', 'callbacks', | ||||||||||||||||||||||||||||||||||||||
| 129 | 'cb reduction', 'peak'; | ||||||||||||||||||||||||||||||||||||||
| 130 | 1 | for my $row (@summary) { | |||||||||||||||||||||||||||||||||||||
| 131 | printf "%-6s %-7s %10d %12.1f %+10.1f%% %11.0f %11.1f%% %10.0f\n", | ||||||||||||||||||||||||||||||||||||||
| 132 | $row->{transport}, $row->{mode}, $row->{batch}, | ||||||||||||||||||||||||||||||||||||||
| 133 | $row->{median_payload_mib_per_second}, | ||||||||||||||||||||||||||||||||||||||
| 134 | $row->{throughput_change_percent} // 0, | ||||||||||||||||||||||||||||||||||||||
| 135 | $row->{median_callback_calls}, | ||||||||||||||||||||||||||||||||||||||
| 136 | $row->{callback_reduction_percent} // 0, | ||||||||||||||||||||||||||||||||||||||
| 137 | 4 | ▶ | $row->{median_peak_batch}; | ||||||||||||||||||||||||||||||||||||
|
Condition50%2/4
$row->{"throughput_change_percent"} // 0
$row->{"callback_reduction_percent"} // 0
MC/DC0%0/1
$row->{"throughput_change_percent"} // 0
$row->{"throughput_change_percent"}
MC/DC0%0/1
$row->{"callback_reduction_percent"} // 0
$row->{"callback_reduction_percent"}
Truth table50%1/2
A
A= $row->{"throughput_change_percent"}
Truth table50%1/2
A
A= $row->{"callback_reduction_percent"}
| |||||||||||||||||||||||||||||||||||||||
| 138 | } | ||||||||||||||||||||||||||||||||||||||
| 139 | |||||||||||||||||||||||||||||||||||||||
| 140 | 1 | ▶ | if (defined $json_path) { | ||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||
| 141 | 1 | my $report = { | |||||||||||||||||||||||||||||||||||||
| 142 | benchmark => 'linux-event-callback-batching-microbench', | ||||||||||||||||||||||||||||||||||||||
| 143 | benchmark_contract_version => 1, | ||||||||||||||||||||||||||||||||||||||
| 144 | linux_event_version => $Linux::Event::VERSION, | ||||||||||||||||||||||||||||||||||||||
| 145 | configuration => { | ||||||||||||||||||||||||||||||||||||||
| 146 | messages => $messages, | ||||||||||||||||||||||||||||||||||||||
| 147 | bytes => $bytes, | ||||||||||||||||||||||||||||||||||||||
| 148 | read_size => $read_size, | ||||||||||||||||||||||||||||||||||||||
| 149 | raw_batch_bytes => \@raw_batch_bytes, | ||||||||||||||||||||||||||||||||||||||
| 150 | message_batch_sizes => \@message_batch_sizes, | ||||||||||||||||||||||||||||||||||||||
| 151 | transports => \@transports, | ||||||||||||||||||||||||||||||||||||||
| 152 | warmup => $warmup, | ||||||||||||||||||||||||||||||||||||||
| 153 | repeats => $repeats, | ||||||||||||||||||||||||||||||||||||||
| 154 | }, | ||||||||||||||||||||||||||||||||||||||
| 155 | raw => \@raw, | ||||||||||||||||||||||||||||||||||||||
| 156 | summary => \@summary, | ||||||||||||||||||||||||||||||||||||||
| 157 | }; | ||||||||||||||||||||||||||||||||||||||
| 158 | 1 | ▶ | open my $json, '>', $json_path or die "open $json_path: $!\n"; | ||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||
| 159 | 1 | print {$json} JSON::PP->new->canonical->pretty->encode($report); | |||||||||||||||||||||||||||||||||||||
| 160 | 1 | ▶ | close $json or die "close $json_path: $!\n"; | ||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||
| 161 | } | ||||||||||||||||||||||||||||||||||||||
| 162 | |||||||||||||||||||||||||||||||||||||||
| 163 | 14 | ▶ | sub run_case ($case) { | ||||||||||||||||||||||||||||||||||||
|
Subroutine
run_case: called CC=18 SCAR=29.6
| |||||||||||||||||||||||||||||||||||||||
| 164 | 14 | my ($receiver, $sender) = connected_pair($case->{transport}); | |||||||||||||||||||||||||||||||||||||
| 165 | 14 | ▶ | pipe(my $gate_read, my $gate_write) or die "gate pipe: $!"; | ||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||
| 166 | |||||||||||||||||||||||||||||||||||||||
| 167 | 14 | my $payload = 'x' x $bytes; | |||||||||||||||||||||||||||||||||||||
| 168 | 14 | ▶ | my $wire = $case->{mode} eq 'framed' ? $payload . "\n" : $payload; | ||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||
| 169 | 14 | my $writer = fork(); | |||||||||||||||||||||||||||||||||||||
| 170 | 14 | ▶ | die "writer fork: $!" if !defined $writer; | ||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||
| 171 | 14 | ▶ | if ($writer == 0) { | ||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||
| 172 | 4 | close $receiver; | |||||||||||||||||||||||||||||||||||||
| 173 | 4 | close $gate_write; | |||||||||||||||||||||||||||||||||||||
| 174 | 4 | my $gate = ''; | |||||||||||||||||||||||||||||||||||||
| 175 | 4 | ▶ | sysread($gate_read, $gate, 1) == 1 or exit 2; | ||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||
| 176 | 4 | close $gate_read; | |||||||||||||||||||||||||||||||||||||
| 177 | 4 | ▶ | eval { write_messages($sender, $wire, $messages); 1 } or exit 3; | ||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||
| 178 | 4 | close $sender; | |||||||||||||||||||||||||||||||||||||
| 179 | 4 | exit 0; | |||||||||||||||||||||||||||||||||||||
| 180 | } | ||||||||||||||||||||||||||||||||||||||
| 181 | |||||||||||||||||||||||||||||||||||||||
| 182 | 10 | close $sender; | |||||||||||||||||||||||||||||||||||||
| 183 | 10 | close $gate_read; | |||||||||||||||||||||||||||||||||||||
| 184 | 10 | my $loop = Linux::Event::Loop->new; | |||||||||||||||||||||||||||||||||||||
| 185 | my $state = { | ||||||||||||||||||||||||||||||||||||||
| 186 | loop => $loop, | ||||||||||||||||||||||||||||||||||||||
| 187 | mode => $case->{mode}, | ||||||||||||||||||||||||||||||||||||||
| 188 | 10 | messages => 0, | |||||||||||||||||||||||||||||||||||||
| 189 | bytes => 0, | ||||||||||||||||||||||||||||||||||||||
| 190 | expected_messages => $messages, | ||||||||||||||||||||||||||||||||||||||
| 191 | expected_bytes => $messages * $bytes, | ||||||||||||||||||||||||||||||||||||||
| 192 | }; | ||||||||||||||||||||||||||||||||||||||
| 193 | 10 | my $class = benchmark_class($case->{mode}, $case->{batch}); | |||||||||||||||||||||||||||||||||||||
| 194 | 10 | my $stream = $class->new(loop => $loop, fh => $receiver, data => $state); | |||||||||||||||||||||||||||||||||||||
| 195 | |||||||||||||||||||||||||||||||||||||||
| 196 | 10 | my $wall_start = clock_gettime(CLOCK_MONOTONIC); | |||||||||||||||||||||||||||||||||||||
| 197 | 10 | my $cpu_start = clock_gettime(CLOCK_PROCESS_CPUTIME_ID); | |||||||||||||||||||||||||||||||||||||
| 198 | 10 | ▶ | syswrite($gate_write, 'g') == 1 or die "release writer: $!"; | ||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||
| 199 | 10 | close $gate_write; | |||||||||||||||||||||||||||||||||||||
| 200 | |||||||||||||||||||||||||||||||||||||||
| 201 | 0 | ▶ | local $SIG{ALRM} = sub { die "batching benchmark timed out\n" }; | ||||||||||||||||||||||||||||||||||||
|
Subroutine
__ANON__: not called CC=1 SCAR=1.2
| |||||||||||||||||||||||||||||||||||||||
| 202 | 10 | alarm 60; | |||||||||||||||||||||||||||||||||||||
| 203 | 10 | my $ok = eval { $loop->run; 1 }; | |||||||||||||||||||||||||||||||||||||
| 204 | 10 | my $error = $@; | |||||||||||||||||||||||||||||||||||||
| 205 | 10 | alarm 0; | |||||||||||||||||||||||||||||||||||||
| 206 | 10 | my $cpu_end = clock_gettime(CLOCK_PROCESS_CPUTIME_ID); | |||||||||||||||||||||||||||||||||||||
| 207 | 10 | my $wall_end = clock_gettime(CLOCK_MONOTONIC); | |||||||||||||||||||||||||||||||||||||
| 208 | |||||||||||||||||||||||||||||||||||||||
| 209 | 10 | ▶ | if (!$ok) { | ||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||
| 210 | 0 | kill 'TERM', $writer; | |||||||||||||||||||||||||||||||||||||
| 211 | 0 | waitpid($writer, 0); | |||||||||||||||||||||||||||||||||||||
| 212 | 0 | die $error; | |||||||||||||||||||||||||||||||||||||
| 213 | } | ||||||||||||||||||||||||||||||||||||||
| 214 | 10 | waitpid($writer, 0); | |||||||||||||||||||||||||||||||||||||
| 215 | 10 | ▶ | die "writer failed with status $?\n" if $? != 0; | ||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||
| 216 | |||||||||||||||||||||||||||||||||||||||
| 217 | 10 | my $stats = $stream->{xs_state}->stats; | |||||||||||||||||||||||||||||||||||||
| 218 | 10 | ▶ | my $got = $case->{mode} eq 'framed' ? $state->{messages} : $state->{bytes}; | ||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||
| 219 | my $expected = $case->{mode} eq 'framed' | ||||||||||||||||||||||||||||||||||||||
| 220 | 10 | ▶ | ? $state->{expected_messages} : $state->{expected_bytes}; | ||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||
| 221 | 10 | ▶ | die "received $got, expected $expected\n" if $got != $expected; | ||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||
| 222 | |||||||||||||||||||||||||||||||||||||||
| 223 | 10 | my $elapsed = $wall_end - $wall_start; | |||||||||||||||||||||||||||||||||||||
| 224 | 10 | my $cpu = $cpu_end - $cpu_start; | |||||||||||||||||||||||||||||||||||||
| 225 | 10 | my $payload_bytes = $messages * $bytes; | |||||||||||||||||||||||||||||||||||||
| 226 | 10 | my $payload_mib = $payload_bytes / 1_048_576; | |||||||||||||||||||||||||||||||||||||
| 227 | my $callback_calls = $case->{mode} eq 'framed' | ||||||||||||||||||||||||||||||||||||||
| 228 | ? $stats->{message_callback_calls} + $stats->{message_batch_calls} | ||||||||||||||||||||||||||||||||||||||
| 229 | 10 | ▶ | : $stats->{delivery_calls}; | ||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||
| 230 | my $peak_batch = $case->{mode} eq 'framed' | ||||||||||||||||||||||||||||||||||||||
| 231 | ? ($stats->{message_batch_peak_messages} || 1) | ||||||||||||||||||||||||||||||||||||||
| 232 | 10 | ▶ | : ($stats->{read_batch_peak_bytes} || $read_size); | ||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition80%4/5
$stats->{"message_batch_peak_messages"} or 1
$stats->{"read_batch_peak_bytes"} or $read_size
MC/DC100%1/1
$stats->{"message_batch_peak_messages"} or 1
$stats->{"message_batch_peak_messages"}
MC/DC0%0/2
$stats->{"read_batch_peak_bytes"} or $read_size
$stats->{"read_batch_peak_bytes"}
$read_size
Truth table100%2/2
A
A= $stats->{"message_batch_peak_messages"}
Truth table66%2/3
A or B
A= $stats->{"read_batch_peak_bytes"}B= $read_size
| |||||||||||||||||||||||||||||||||||||||
| 233 | |||||||||||||||||||||||||||||||||||||||
| 234 | 10 | ▶ | $stream->close if !$stream->is_closed; | ||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||
| 235 | return { | ||||||||||||||||||||||||||||||||||||||
| 236 | %$case, | ||||||||||||||||||||||||||||||||||||||
| 237 | elapsed_seconds => 0 + $elapsed, | ||||||||||||||||||||||||||||||||||||||
| 238 | receiver_cpu_seconds => 0 + $cpu, | ||||||||||||||||||||||||||||||||||||||
| 239 | payload_bytes => $payload_bytes, | ||||||||||||||||||||||||||||||||||||||
| 240 | payload_mib_per_second => $payload_mib / $elapsed, | ||||||||||||||||||||||||||||||||||||||
| 241 | messages_per_second => $messages / $elapsed, | ||||||||||||||||||||||||||||||||||||||
| 242 | cpu_us_per_mib => $cpu * 1_000_000 / $payload_mib, | ||||||||||||||||||||||||||||||||||||||
| 243 | callback_calls => $callback_calls, | ||||||||||||||||||||||||||||||||||||||
| 244 | read_calls => $stats->{read_calls}, | ||||||||||||||||||||||||||||||||||||||
| 245 | peak_batch => $peak_batch, | ||||||||||||||||||||||||||||||||||||||
| 246 | frames_emitted => $stats->{frames_emitted}, | ||||||||||||||||||||||||||||||||||||||
| 247 | read_batch_flushes => $stats->{read_batch_flushes}, | ||||||||||||||||||||||||||||||||||||||
| 248 | message_batch_calls => $stats->{message_batch_calls}, | ||||||||||||||||||||||||||||||||||||||
| 249 | 10 | }; | |||||||||||||||||||||||||||||||||||||
| 250 | } | ||||||||||||||||||||||||||||||||||||||
| 251 | |||||||||||||||||||||||||||||||||||||||
| 252 | 1 | my %benchmark_class; | |||||||||||||||||||||||||||||||||||||
| 253 | 10 | ▶ | sub benchmark_class ($mode, $batch) { | ||||||||||||||||||||||||||||||||||||
|
Subroutine
benchmark_class: called CC=7 SCAR=19.5
| |||||||||||||||||||||||||||||||||||||||
| 254 | 10 | my $key = "$mode:$batch:$read_size"; | |||||||||||||||||||||||||||||||||||||
| 255 | 10 | ▶ | return $benchmark_class{$key} if $benchmark_class{$key}; | ||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||
| 256 | 10 | my $suffix = join '_', $mode, $batch, $read_size; | |||||||||||||||||||||||||||||||||||||
| 257 | 10 | my $class = "Linux::Event::Bench::CallbackBatch::$suffix"; | |||||||||||||||||||||||||||||||||||||
| 258 | |||||||||||||||||||||||||||||||||||||||
| 259 | 10 | ▶ | if ($mode eq 'framed') { | ||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||
| 260 | 3 | ▶ | eval qq{ | ||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
Subroutine
BEGIN: called CC=1 SCAR=0.0
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||
| 261 | package $class; | ||||||||||||||||||||||||||||||||||||||
| 262 | use parent 'Linux::Event::IO::Sock::Stream'; | ||||||||||||||||||||||||||||||||||||||
| 263 | use Linux::Event::Framer 'Delimiter', "\\n"; | ||||||||||||||||||||||||||||||||||||||
| 264 | 1; | ||||||||||||||||||||||||||||||||||||||
| 265 | } or die "define framed benchmark class: $@"; | ||||||||||||||||||||||||||||||||||||||
| 266 | } else { | ||||||||||||||||||||||||||||||||||||||
| 267 | 5 | ▶ | no strict 'refs'; | ||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||
| 268 | 7 | @{"${class}::ISA"} = ('Linux::Event::IO::Sock::Stream'); | |||||||||||||||||||||||||||||||||||||
| 269 | } | ||||||||||||||||||||||||||||||||||||||
| 270 | |||||||||||||||||||||||||||||||||||||||
| 271 | 5 | ▶ | no strict 'refs'; | ||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||
| 272 | 10 | *{"${class}::stream_tuning"} = $mode eq 'raw' | |||||||||||||||||||||||||||||||||||||
| 273 | 7 | ▶ | ? sub ($class_name) { | ||||||||||||||||||||||||||||||||||||
|
Subroutine
__ANON__: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||
| 274 | 7 | return read_size => $read_size, read_batch_bytes => $batch; | |||||||||||||||||||||||||||||||||||||
| 275 | } | ||||||||||||||||||||||||||||||||||||||
| 276 | 3 | ▶ | : sub ($class_name) { | ||||||||||||||||||||||||||||||||||||
|
Subroutine
__ANON__: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||
| 277 | 3 | return read_size => $read_size, message_batch_size => $batch; | |||||||||||||||||||||||||||||||||||||
| 278 | 10 | ▶ | }; | ||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||
| 279 | 10 | ▶ | if ($mode eq 'raw') { | ||||||||||||||||||||||||||||||||||||
|
Branch: 2 branches
| |||||||||||||||||||||||||||||||||||||||
| 280 | 7 | ▶ | *{"${class}::on_data"} = sub ($stream, $chunk) { | ||||||||||||||||||||||||||||||||||||
|
Subroutine
__ANON__: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||
| 281 | 1189 | $stream->data->{bytes} += length($chunk); | |||||||||||||||||||||||||||||||||||||
| 282 | 7 | }; | |||||||||||||||||||||||||||||||||||||
| 283 | } elsif ($batch) { | ||||||||||||||||||||||||||||||||||||||
| 284 | 1 | ▶ | *{"${class}::on_messages"} = sub ($stream, $batch_messages) { | ||||||||||||||||||||||||||||||||||||
|
Subroutine
__ANON__: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||
| 285 | 250 | $stream->data->{messages} += scalar @$batch_messages; | |||||||||||||||||||||||||||||||||||||
| 286 | 1 | }; | |||||||||||||||||||||||||||||||||||||
| 287 | } else { | ||||||||||||||||||||||||||||||||||||||
| 288 | 2 | ▶ | *{"${class}::on_message"} = sub ($stream, $message) { | ||||||||||||||||||||||||||||||||||||
|
Subroutine
__ANON__: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||
| 289 | 2000 | $stream->data->{messages}++; | |||||||||||||||||||||||||||||||||||||
| 290 | 2 | }; | |||||||||||||||||||||||||||||||||||||
| 291 | } | ||||||||||||||||||||||||||||||||||||||
| 292 | 10 | ▶ | *{"${class}::on_eof"} = sub ($stream) { $stream->data->{loop}->stop }; | ||||||||||||||||||||||||||||||||||||
|
Subroutine
__ANON__: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||
| 293 | 10 | ▶ | *{"${class}::on_error"} = sub ($stream, $error) { | ||||||||||||||||||||||||||||||||||||
|
Subroutine
__ANON__: not called CC=1 SCAR=1.2
| |||||||||||||||||||||||||||||||||||||||
| 294 | 0 | die "benchmark Stream error: $error\n"; | |||||||||||||||||||||||||||||||||||||
| 295 | 10 | }; | |||||||||||||||||||||||||||||||||||||
| 296 | 10 | $benchmark_class{$key} = $class; | |||||||||||||||||||||||||||||||||||||
| 297 | 10 | return $class; | |||||||||||||||||||||||||||||||||||||
| 298 | } | ||||||||||||||||||||||||||||||||||||||
| 299 | |||||||||||||||||||||||||||||||||||||||
| 300 | 14 | ▶ | sub connected_pair ($transport) { | ||||||||||||||||||||||||||||||||||||
|
Subroutine
connected_pair: called CC=6 SCAR=29.7
| |||||||||||||||||||||||||||||||||||||||
| 301 | 14 | ▶ | if ($transport eq 'unix') { | ||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||
| 302 | 14 | ▶ | socketpair(my $left, my $right, AF_UNIX, SOCK_STREAM, PF_UNSPEC) | ||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||
| 303 | or die "socketpair: $!"; | ||||||||||||||||||||||||||||||||||||||
| 304 | 14 | return ($left, $right); | |||||||||||||||||||||||||||||||||||||
| 305 | } | ||||||||||||||||||||||||||||||||||||||
| 306 | |||||||||||||||||||||||||||||||||||||||
| 307 | 0 | ▶ | my $listener = IO::Socket::INET->new( | ||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||
| 308 | LocalAddr => '127.0.0.1', LocalPort => 0, | ||||||||||||||||||||||||||||||||||||||
| 309 | Proto => 'tcp', Listen => 1, ReuseAddr => 1, | ||||||||||||||||||||||||||||||||||||||
| 310 | ) or die "TCP listener: $!"; | ||||||||||||||||||||||||||||||||||||||
| 311 | 0 | ▶ | my $sender = IO::Socket::INET->new( | ||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||
| 312 | PeerAddr => '127.0.0.1', PeerPort => $listener->sockport, | ||||||||||||||||||||||||||||||||||||||
| 313 | Proto => 'tcp', | ||||||||||||||||||||||||||||||||||||||
| 314 | ) or die "TCP connect: $!"; | ||||||||||||||||||||||||||||||||||||||
| 315 | 0 | ▶ | my $receiver = $listener->accept or die "TCP accept: $!"; | ||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||
| 316 | 0 | close $listener; | |||||||||||||||||||||||||||||||||||||
| 317 | 0 | return ($receiver, $sender); | |||||||||||||||||||||||||||||||||||||
| 318 | } | ||||||||||||||||||||||||||||||||||||||
| 319 | |||||||||||||||||||||||||||||||||||||||
| 320 | 4 | ▶ | sub write_messages ($fh, $wire, $count) { | ||||||||||||||||||||||||||||||||||||
|
Subroutine
write_messages: called CC=5 SCAR=16.4
| |||||||||||||||||||||||||||||||||||||||
| 321 | 4 | my $per_chunk = int(65_536 / length($wire)); | |||||||||||||||||||||||||||||||||||||
| 322 | 4 | ▶ | $per_chunk = 1 if $per_chunk < 1; | ||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||
| 323 | 4 | my $chunk = $wire x $per_chunk; | |||||||||||||||||||||||||||||||||||||
| 324 | 4 | ▶ | while ($count > 0) { | ||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||
| 325 | 4 | ▶ | my $take = $count < $per_chunk ? $count : $per_chunk; | ||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||
| 326 | 4 | ▶ | my $bytes = $take == $per_chunk ? $chunk : $wire x $take; | ||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||
| 327 | 4 | write_all($fh, $bytes); | |||||||||||||||||||||||||||||||||||||
| 328 | 4 | $count -= $take; | |||||||||||||||||||||||||||||||||||||
| 329 | } | ||||||||||||||||||||||||||||||||||||||
| 330 | } | ||||||||||||||||||||||||||||||||||||||
| 331 | |||||||||||||||||||||||||||||||||||||||
| 332 | 4 | ▶ | sub write_all ($fh, $bytes) { | ||||||||||||||||||||||||||||||||||||
|
Subroutine
write_all: called CC=4 SCAR=15.2
| |||||||||||||||||||||||||||||||||||||||
| 333 | 4 | my $offset = 0; | |||||||||||||||||||||||||||||||||||||
| 334 | 4 | my $length = length($bytes); | |||||||||||||||||||||||||||||||||||||
| 335 | 4 | ▶ | while ($offset < $length) { | ||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||
| 336 | 4 | my $written = syswrite($fh, $bytes, $length - $offset, $offset); | |||||||||||||||||||||||||||||||||||||
| 337 | 4 | ▶ | if (defined $written) { | ||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||
| 338 | 4 | $offset += $written; | |||||||||||||||||||||||||||||||||||||
| 339 | 4 | next; | |||||||||||||||||||||||||||||||||||||
| 340 | } | ||||||||||||||||||||||||||||||||||||||
| 341 | 0 | ▶ | next if $!{EINTR}; | ||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||
| 342 | 0 | die "writer syswrite: $!"; | |||||||||||||||||||||||||||||||||||||
| 343 | } | ||||||||||||||||||||||||||||||||||||||
| 344 | } | ||||||||||||||||||||||||||||||||||||||
| 345 | |||||||||||||||||||||||||||||||||||||||
| 346 | 5 | ▶ | sub rotate_cases ($cases, $offset) { | ||||||||||||||||||||||||||||||||||||
|
Subroutine
rotate_cases: called CC=2 SCAR=7.1
| |||||||||||||||||||||||||||||||||||||||
| 347 | 5 | ▶ | return @$cases if !@$cases; | ||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||
| 348 | 5 | $offset %= @$cases; | |||||||||||||||||||||||||||||||||||||
| 349 | 5 | return (@$cases[$offset .. $#$cases], @$cases[0 .. $offset - 1]); | |||||||||||||||||||||||||||||||||||||
| 350 | } | ||||||||||||||||||||||||||||||||||||||
| 351 | |||||||||||||||||||||||||||||||||||||||
| 352 | 24 | ▶ | sub median (@values) { | ||||||||||||||||||||||||||||||||||||
|
Subroutine
median: called CC=2 SCAR=7.6
| |||||||||||||||||||||||||||||||||||||||
| 353 | 0 | @values = sort { $a <=> $b } @values; | |||||||||||||||||||||||||||||||||||||
| 354 | 24 | my $middle = int(@values / 2); | |||||||||||||||||||||||||||||||||||||
| 355 | 24 | ▶ | return @values % 2 | ||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||
| 356 | ? $values[$middle] | ||||||||||||||||||||||||||||||||||||||
| 357 | : ($values[$middle - 1] + $values[$middle]) / 2; | ||||||||||||||||||||||||||||||||||||||
| 358 | } | ||||||||||||||||||||||||||||||||||||||
| 359 | |||||||||||||||||||||||||||||||||||||||
| 360 | 0 | ▶ | sub usage ($exit) { | ||||||||||||||||||||||||||||||||||||
|
Subroutine
usage: not called CC=1 SCAR=6.9
| |||||||||||||||||||||||||||||||||||||||
| 361 | 0 | print <<'USAGE'; | |||||||||||||||||||||||||||||||||||||
| 362 | Usage: run-callback-batching-microbench.pl [options] | ||||||||||||||||||||||||||||||||||||||
| 363 | --messages=N logical payloads per case (default: 200000) | ||||||||||||||||||||||||||||||||||||||
| 364 | --bytes=N payload bytes (default: 64) | ||||||||||||||||||||||||||||||||||||||
| 365 | --read-size=N native syscall read size (default: 4096) | ||||||||||||||||||||||||||||||||||||||
| 366 | --raw-batch-bytes=LIST zero or byte limits (default: 0,16384,65536,262144) | ||||||||||||||||||||||||||||||||||||||
| 367 | --message-batch-sizes=LIST zero or frame limits (default: 0,1,4,16,64,256) | ||||||||||||||||||||||||||||||||||||||
| 368 | --transports=LIST unix,tcp (default: unix,tcp) | ||||||||||||||||||||||||||||||||||||||
| 369 | --warmup=N untimed case sweeps (default: 1) | ||||||||||||||||||||||||||||||||||||||
| 370 | --repeats=N measured sweeps (default: 5) | ||||||||||||||||||||||||||||||||||||||
| 371 | --json=PATH write machine-readable report | ||||||||||||||||||||||||||||||||||||||
| 372 | --help show this help | ||||||||||||||||||||||||||||||||||||||
| 373 | |||||||||||||||||||||||||||||||||||||||
| 374 | Zero selects the ordinary callback path. Raw rows report byte aggregation; | ||||||||||||||||||||||||||||||||||||||
| 375 | framed rows use newline-delimited pipelined messages and explicit array batches. | ||||||||||||||||||||||||||||||||||||||
| 376 | USAGE | ||||||||||||||||||||||||||||||||||||||
| 377 | 0 | exit $exit; | |||||||||||||||||||||||||||||||||||||
| 378 | } | ||||||||||||||||||||||||||||||||||||||