view release on metacpan or search on metacpan
st/Check/OneHash.pm view on Meta::CPAN
use AnyEvent;
use Coro;
use Coro::AnyEvent;
use DR::Tarantool ':constant';
use constant ITERATIONS => cfg 'check.onehash.iterations';
sub start {
my $done_time = 0;
my $total = 0;
st/Check/OneHash.pm view on Meta::CPAN
$done_time += $period;
$total += ITERATIONS;
$total_errors += $errors;
df '%d iterations in %3.3f seconds (%d errors)',
$total,
$done_time,
$total_errors
;
view all matches for this distribution
view release on metacpan or search on metacpan
dta-cab-http-client.perl view on Meta::CPAN
our %qfo = (
#encoding => 'UTF-8',
);
our (%ifo,%ofo, $qfmt,$ifmt,$ofmt);
our $bench_iters = 1; ##-- number of benchmark iterations for -bench mode
our $trace_request_file = undef; ##-- trace request to file?
##==============================================================================
## Command-line
GetOptions(##-- General
view all matches for this distribution
view release on metacpan or search on metacpan
timetheese/performance.pl view on Meta::CPAN
@params,
'no_cache' => 1,
);
}
print "This is a test for optimisation iterations\n";
timethese( 100000, {
'1 Cache key ' => \&dtl_cache_key,
'2 Decompress ' => \&dtl_decompress,
'3 Serialize ' => \&dtl_serialize,
view all matches for this distribution
view release on metacpan or search on metacpan
last if ( $result or $count >= $limit );
sleep 1;
}
ok( $result, $label );
note("Previous test took $count wait iterations to complete");
}
time_test( sub {
my $log_file = &get_log_file;
return 1 if (
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Dancer2/Plugin/Auth/YARBAC/Provider/Base.pm view on Meta::CPAN
has pw_numbers => ( is => 'ro', default => \&_pw_numbers, lazy => 1 );
has pw_required_score => ( is => 'ro', default => \&_pw_required_score, lazy => 1 );
has pw_truncate => ( is => 'ro', default => \&_pw_truncate, lazy => 1 );
has hash_class => ( is => 'ro', default => sub { 'HMACSHA2' } );
has hash_args => ( is => 'ro', default => sub { { sha_size => 512, } } );
has iterations => ( is => 'ro', default => \&_iterations, lazy => 1 );
has output_len => ( is => 'ro', default => \&_output_len, lazy => 1 );
has salt_len => ( is => 'ro', default => \&_salt_len, lazy => 1 );
has pbkdf2 => ( is => 'ro', default => \&_pbkdf2, lazy => 1 );
sub _pw_min_length
lib/Dancer2/Plugin/Auth/YARBAC/Provider/Base.pm view on Meta::CPAN
&& $self->settings->{password_strength}->{truncate} =~ m{^\d$} )
? $self->settings->{password_strength}->{truncate}
: 1;
}
sub _iterations
{
my $self = shift;
return ( defined $self->settings->{PBKDF2}->{iterations}
&& $self->settings->{PBKDF2}->{iterations} =~ m{^\d^} )
? $self->settings->{PBKDF2}->{iterations}
: 4000;
}
sub _output_len
{
lib/Dancer2/Plugin/Auth/YARBAC/Provider/Base.pm view on Meta::CPAN
my $self = shift;
return Crypt::PBKDF2->new(
hash_class => $self->hash_class,
hash_args => $self->hash_args,
iterations => $self->iterations,
output_len => $self->output_len,
salt_len => $self->salt_len,
);
}
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Dancer2/Core/Role/HasLocation.pm view on Meta::CPAN
#we try to find bin and lib
my $subdir = $location;
my $subdir_found = 0;
#maximum of 10 iterations, to prevent infinite loop
for ( 1 .. 10 ) {
#try to find libdir and bindir to determine the root of dancer app
my $libdir = $subdir->child('lib');
my $bindir = $subdir->child('bin');
view all matches for this distribution
view release on metacpan or search on metacpan
share/assets/dash_core_components/async~plotlyjs.js view on Meta::CPAN
(window.webpackJsonpdash_core_components=window.webpackJsonpdash_core_components||[]).push([[5],{685:function(t,e){!function(r){"object"==typeof e&&void 0!==t?t.exports=r():"function"==typeof define&&define.amd?define([],r):("undefined"!=typeof windo...
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Data/AnyXfer/From/DBIC.pm view on Meta::CPAN
sub get_iterator {
my $rs = $_[0]->from_rs;
# check that resultset has some data to iterate over - this
# should prevent empty iterations caused by an empty table or some
# other glitch returning zero results. Please note there may still
# be issues after this in the iteration phase which this check will
# not catch?
if ( $rs->count < 1 ) {
croak sprintf 'ERROR: %s has a row count of 0', ref $rs;
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Data/ArrayList.pm view on Meta::CPAN
that would be returned by an initial call to next. An initial call to previous
would return the element with the specified index minus one.
Iterator will die with C<ConcurrentModification> if the parent list has been
I<structurally modified>. Structural modifications are those that change the
size of the list, or otherwise perturb it in such a fashion that iterations in
progress may yield incorrect results.
=head2 subList
my $sl = $dal->subList( $rangeFrom, $rangeTo );
view all matches for this distribution
view release on metacpan or search on metacpan
examples/runbench.pl view on Meta::CPAN
#!/usr/bin/perl -w
$disk = "disk1s9";
$tmplocation = "/Volumes/Test/testfile.tmp";
$iterations = 5;
# set the iterations to how many runs of iozone you want to do for each filesystem
$i = 0;
system("/usr/sbin/diskutil eraseVolume Ext2 Test $disk");
while ($i<$iterations)
{
print "Ext2 $disk - \#$i - " . scalar localtime() . "\n";
system("/usr/local/bin/iozone -g 1G -+u -Rab $disk-noJournal-full-$i.wks -f $tmplocation > $disk-full-ext2-$i.log") ;
system("/usr/sbin/diskutil eraseVolume Ext2 Test $disk");
$i++;
examples/runbench.pl view on Meta::CPAN
#Run the next set with hfs
$i = 0;
system("/usr/sbin/diskutil eraseVolume HFS Test $disk");
while ($i<$iterations)
{
print "HFS \#$i" . scalar localtime() . "\n";
system("/usr/local/bin/iozone -g 1G -+u -Rab $disk-Journal-full-$i.wks -f $tmplocation > $disk-full-hfs-$i.log");
system("/usr/sbin/diskutil eraseVolume HFS+ Test $disk");
$i++;
examples/runbench.pl view on Meta::CPAN
#Run the next set with ufs
$i = 0;
system("/usr/sbin/diskutil eraseVolume UFS Test $disk");
while ($i<$iterations)
{
print "UFS \#$i" . scalar localtime() . "\n";
system("/usr/local/bin/iozone -g 1G -+u -Rab $disk-Journal-full-$i.wks -f $tmplocation > $disk-full-ufs-$i.log");
system("/usr/sbin/diskutil eraseVolume UFS Test $disk");
$i++;
examples/runbench.pl view on Meta::CPAN
#Run the next set with hfs+
$i = 0;
system("/usr/sbin/diskutil eraseVolume HFS+ Test $disk");
while ($i<$iterations)
{
print "HFS+ \#$i" . scalar localtime() . "\n";
system("/usr/local/bin/iozone -g 1G -+u -Rab $disk-Journal-full-$i.wks -f $tmplocation > $disk-full-hfsplus-$i.log");
system("/usr/sbin/diskutil eraseVolume HFS+ Test $disk");
$i++;
}
#Run the next set with hfs+ with journaling turned on
$i = 0;
while ($i<$iterations)
{
print "Journaled - $disk - \#$i - " . scalar localtime() . "\n";
system("/usr/sbin/diskutil enableJournal $disk");
system("/usr/local/bin/iozone -g 1G -+u -Rab $disk-Journal-full-$i.wks -f $tmplocation > $disk-full-hfsplusJournal-$i.log");
system("/usr/sbin/diskutil eraseVolume HFS+ Test $disk");
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Data/CompactReadonly/V0/Dictionary.pm view on Meta::CPAN
}
}
}
# Efficient binary search. Relies on elements' being ASCIIbetically sorted by key.
# 1 <= iterations to find key (or find that there is no key) <= ceil(log2(N))
# so no more than 4 iterations for a ten element list, no more than 20 for
# a million element list. Each iteration takes two seeks and two reads there
# are then two more seeks and reads to get the value
sub element {
my($self, $element) = @_;
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Data/Consumer.pm view on Meta::CPAN
=item max_passes => $num_or_undef
Normally C<consume()> will loop through the data set until it is
exhausted. By setting this parameter you can control the maximum number
of iterations, for instance setting it to C<1> will result in a single
pass through the data per invocation. If C<0> (or any other false value)
is treated as meaning "loop until exhausted".
=item max_processed => $num_or_undef
view all matches for this distribution
view release on metacpan or search on metacpan
xt/02_collisions.t view on Meta::CPAN
my $fn_name = Sub::Util::subname $fn;
for ( my $i = 0; $i < $max; $i++ ) {
my $id = $fn->();
ok !$ids{$id}, "$id is unique in $i iterations ($fn_name)";
++$ids{$id};
}
};
$test->( \&Data::Cuid::cuid );
view all matches for this distribution
view release on metacpan or search on metacpan
t/80_random.t view on Meta::CPAN
# See if anything hits an assertion crash
my $start_time = time;
my $iter = 0;
while (time < $start_time+$time_limit) {
# Do several iterations between OS calls to get current time
for (1..$iters_btw_timechecks) {
++$iter;
#$Data::Dumper::Interp::Debug = 1 if $iter==21;
@saved_items = ();
my $item = gen_item();
t/80_random.t view on Meta::CPAN
}
die "Result contains magic token" if $r =~ /Magic/s;
#diag "Iter $iter : vis result length = ",length($r);
}
}
ok(1, "Stopped after time limit expired ($time_limit seconds). $iter iterations completed.");
done_testing();
exit 0;
view all matches for this distribution
view release on metacpan or search on metacpan
bench/each.pl view on Meta::CPAN
# Perl hashes
my %h_ii; $h_ii{$_} = $_ for 1 .. $N;
my %h_ss; $h_ss{"k$_"} = "v$_" for 1 .. $N;
print "-" x 70, "\n";
print "ITERATE all $N entries with each() (iterations/sec)\n";
print "-" x 70, "\n";
cmpthese(-3, {
'perl_ii' => sub {
while (my ($k, $v) = each %h_ii) { }
},
bench/each.pl view on Meta::CPAN
},
});
print "\n";
print "-" x 70, "\n";
print "ITERATE all $N entries with keys() (iterations/sec)\n";
print "-" x 70, "\n";
cmpthese(-3, {
'perl_ii' => sub {
my @k = keys %h_ii;
},
bench/each.pl view on Meta::CPAN
},
});
print "\n";
print "-" x 70, "\n";
print "ITERATE all $N entries with items() vs each-in-loop (iterations/sec)\n";
print "-" x 70, "\n";
cmpthese(-3, {
'perl_each' => sub {
while (my ($k, $v) = each %h_ii) { }
},
view all matches for this distribution
view release on metacpan or search on metacpan
-npro
-nsfs
--blank-lines-before-packages=0
--opening-hash-brace-right
--no-outdent-long-comments
--iterations=2
-wbb="% + - * / x != == >= <= =~ !~ < > | & >= < = **= += *= &= <<= &&= -= /= |= >>= ||= .= %= ^= x="
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Data/Iter.pm view on Meta::CPAN
'all' => (iter counter COUNTER LAST_COUNTER value VALUE key KEY get GET getnext GETNEXT)
=head1 PITFALLS
You should use L<iter()> only on 'quite' static structures. Since the static precalculated iterations
are not tied to the original data structure. So its changes will not be updated.
=head1 AUTHOR
Murat Uenalan, E<lt>muenalan@cpan.orgE<gt>
view all matches for this distribution
view release on metacpan or search on metacpan
eg/bench_cv.pl view on Meta::CPAN
Benchmark::cmpthese($r);
__END__
% perl -Ilib eg/bench_cv.pl .0001 10000
Benchmark: timing 10000 iterations of bare_ae, coro, monad, monad_for, monad_lift...
bare_ae: 1.16068 wallclock secs ( 0.72 usr + 0.06 sys = 0.78 CPU) @ 12820.51/s (n=10000)
coro: 1.16513 wallclock secs ( 0.72 usr + 0.06 sys = 0.78 CPU) @ 12820.51/s (n=10000)
monad: 1.10253 wallclock secs ( 0.87 usr + 0.05 sys = 0.92 CPU) @ 10869.57/s (n=10000)
monad_for: 1.21874 wallclock secs ( 1.18 usr + 0.03 sys = 1.21 CPU) @ 8264.46/s (n=10000)
monad_lift: 1.33561 wallclock secs ( 1.30 usr + 0.03 sys = 1.33 CPU) @ 7518.80/s (n=10000)
eg/bench_cv.pl view on Meta::CPAN
coro 4291/s 15% 5% -- -0% -5%
bare_ae 4308/s 15% 5% 0% -- -5%
monad 4535/s 21% 11% 6% 5% --
% perl -Ilib eg/bench_cv.pl 0 20000
Benchmark: timing 20000 iterations of bare_ae, coro, monad, monad_for, monad_lift...
bare_ae: 0.991276 wallclock secs ( 0.94 usr + 0.04 sys = 0.98 CPU) @ 20408.16/s (n=20000)
coro: 1.01837 wallclock secs ( 0.97 usr + 0.05 sys = 1.02 CPU) @ 19607.84/s (n=20000)
monad: 1.7295 wallclock secs ( 1.68 usr + 0.04 sys = 1.72 CPU) @ 11627.91/s (n=20000)
monad_for: 2.51117 wallclock secs ( 2.44 usr + 0.06 sys = 2.50 CPU) @ 8000.00/s (n=20000)
monad_lift: 2.69432 wallclock secs ( 2.63 usr + 0.07 sys = 2.70 CPU) @ 7407.41/s (n=20000)
view all matches for this distribution
view release on metacpan or search on metacpan
share/dictionary.txt view on Meta::CPAN
alligator
alligator's
alligators
alliteration
alliteration's
alliterations
alliterative
allocate
allocated
allocates
allocating
share/dictionary.txt view on Meta::CPAN
iterated
iterates
iterating
iteration
iteration's
iterations
iterative
iterator
iterators
itinerant
itinerants
share/dictionary.txt view on Meta::CPAN
reiterate
reiterated
reiterates
reiterating
reiteration
reiterations
reject
rejected
rejecting
rejection
rejection's
share/dictionary.txt view on Meta::CPAN
transliterate
transliterated
transliterates
transliterating
transliteration
transliterations
translucence
translucence's
translucent
transmigrate
transmigrated
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Data/Password/zxcvbn/RankedDictionaries/French.pm view on Meta::CPAN
'italiens' => 2737,
'italique' => 14709,
'italiques' => 27235,
'items' => 20126,
'iteration' => 27236,
'iterations' => 26428,
'itineraire' => 8325,
'itineraires' => 9871,
'itinerant' => 17075,
'itinerante' => 15750,
'itinerantes' => 27237,
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Data/Password/zxcvbn/RankedDictionaries/English.pm view on Meta::CPAN
'italy' => 705,
'itasca' => 27790,
'items' => 1785,
'iterated' => 25059,
'iteration' => 10406,
'iterations' => 15499,
'iterative' => 16256,
'ithaca' => 10347,
'itinerant' => 13665,
'its' => 29,
'itself' => 591,
view all matches for this distribution
view release on metacpan or search on metacpan
eg/keyword-vs-native.pl view on Meta::CPAN
defined $miss_kw and die 'kw test data wrong';
print "missing key: both undef, but pathget did NOT autovivify users[5]\n";
print " users count after pathget: ", scalar(@{$data->{users}}), "\n";
# === Throughput ===
print "\nBenchmark (1M iterations each):\n";
cmpthese(-1, {
'native deref' => sub { my $v = $data->{users}[0]{addr}{city}; },
'pathget const' => sub { my $v = pathget $data, "/users/0/addr/city"; },
'pathget dyn' => sub { my $p = "/users/0/addr/city";
my $v = pathget $data, $p; },
view all matches for this distribution
view release on metacpan or search on metacpan
eg/atomic_counters.pl view on Meta::CPAN
# allocate 4 counters
my @counters = map { $pool->alloc } 1..4;
$pool->set($_, 0) for @counters;
printf "%d workers x %d iterations on %d counters\n",
$nworkers, $iters, scalar @counters;
my $t0 = time;
my @pids;
for my $w (1..$nworkers) {
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Data/PowerSet/Hash.pm view on Meta::CPAN
version 0.04
=head1 DESCRIPTION
This provides you with a power set (basically all combinational iterations) for
your hashes. This only does it for hashes, if you want them done for arrays, I
suggest using L<Data::PowerSet>. Please view the I<SEE ALSO> section below.
=head1 SUBROUTINES/METHODS
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Data/Random/Contact/Language/EN.pm view on Meta::CPAN
alligator
alligator's
alligators
alliteration
alliteration's
alliterations
alliterative
allocate
allocated
allocates
allocating
lib/Data/Random/Contact/Language/EN.pm view on Meta::CPAN
iterated
iterates
iterating
iteration
iteration's
iterations
iterative
iterator
iterators
itinerant
itinerants
lib/Data/Random/Contact/Language/EN.pm view on Meta::CPAN
reiterate
reiterated
reiterates
reiterating
reiteration
reiterations
reject
rejected
rejecting
rejection
rejection's
lib/Data/Random/Contact/Language/EN.pm view on Meta::CPAN
transliterate
transliterated
transliterates
transliterating
transliteration
transliterations
translucence
translucence's
translucent
transmigrate
transmigrated
view all matches for this distribution
view release on metacpan or search on metacpan
- Tests use `Test::More` with `done_testing` (no predeclared test count)
- `rand_image.t` skips if `GD` module is not installed
- `rand_time.t` uses `Test::MockTime` to avoid midnight-boundary failures
- POD tests (`z0_pod.t`, `z1_pod-coverage.t`) require `Test::Pod`
- Many tests run 1000 iterations to validate random distributions
## Key Dependencies
- **Runtime**: `Time::Piece` >= 1.16 (core since Perl 5.10)
- **Optional**: `GD` (only for `rand_image`)
view all matches for this distribution
view release on metacpan or search on metacpan
bench/bench.pl view on Meta::CPAN
my ($r, $ri) = $srv->recv;
$srv->reply($ri, $r);
$cli->get($id);
}
my $el = time() - $t0;
printf "Single-process echo: %s req/s (%d iterations, %.1f ms)\n",
fmt_rate($N / $el), $N, $el * 1000;
$srv->unlink;
}
# --- Cross-process echo ---
bench/bench.pl view on Meta::CPAN
for (1..1000) { $cli->req($msg) } # warmup
my $t0 = time();
for (1..$N) { $cli->req($msg) }
my $el = time() - $t0;
printf "Cross-process echo: %s req/s (%d iterations, %.1f ms)\n",
fmt_rate($N / $el), $N, $el * 1000;
waitpid $pid, 0;
$srv->unlink;
}
bench/bench.pl view on Meta::CPAN
$srv->reply($id, $msg);
}
$cli->get($_) for @ids;
}
my $el = time() - $t0;
printf "Batch echo (%d/batch): %s req/s (%d iterations, %.1f ms)\n",
$batch, fmt_rate($total / $el), $total, $el * 1000;
$srv->unlink;
}
# --- req_wait with timeout ---
bench/bench.pl view on Meta::CPAN
for (1..1000) { $cli->req_wait($msg, 5.0) } # warmup
my $t0 = time();
for (1..$N) { $cli->req_wait($msg, 5.0) }
my $el = time() - $t0;
printf "Cross-process req_wait: %s req/s (%d iterations, %.1f ms)\n",
fmt_rate($N / $el), $N, $el * 1000;
waitpid $pid, 0;
$srv->unlink;
}
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Data/Roundtrip.pm view on Meta::CPAN
all the C<< *2dump* >> subs by setting unicode escaping
permanently to false. This improves efficiency, although
one will ever need to
use this in extreme situations where a C<< *2dump* >>
sub is called repeatedly in a loop of
a few hundreds or thousands of iterations or more.
Each time a C<< *2dump* >> is called, the
C<< dont-bloody-escape-unicode >> flag is checked
and if it is set, then L<Data::Dumper>'s C<< qquote() >>
is overriden with C<< _qquote_redefinition_by_Corion() >>
view all matches for this distribution
view release on metacpan or search on metacpan
StkHeader *hdr = h->hdr;
uint32_t t = __atomic_exchange_n(&hdr->top, 0, __ATOMIC_ACQ_REL);
if (t == 0) return 0;
/* Wall-clock deadline for the per-slot wait. We hot-spin first, then
* fall back to short sleeps to avoid burning a core for 2s on a stuck
* slot. The deadline is checked periodically (every 64 iterations) to
* keep the steady-state cost ~zero. */
for (uint32_t i = 0; i < t; i++) {
struct timespec dl;
int dl_set = 0;
uint32_t spins = 0;
view all matches for this distribution
view release on metacpan or search on metacpan
benchmark/ds_vs_eval.pl view on Meta::CPAN
getopts 'hn:b:' => \my %opts or usage;
usage if $opts{h};
my $file = $ARGV[0] or usage;
die "File not found: $file\n" unless -f $file;
my $data = `cat $file`;
my $iterations = $opts{n} || 1000;
my $block_size = $opts{b} || 512;
printf "%s bytes were read\n", length $data;
print "First deserializing by eval...";
benchmark/ds_vs_eval.pl view on Meta::CPAN
unless compare_object $dsf->result, $object;
print " done\n";
my (@delay, @delay_dsr);
my $time = time;
printf "\nStarting %d iterations for eval...", $iterations;
for (1 .. $iterations) {
my $start = time;
my $res = eval $data;
push @delay, time - $start;
}
my $eval_time = time - $time;
printf " done (%3.3f seconds)\n", $eval_time;
printf "Starting %d iterations for Data::StreamDeserializer...", $iterations;
$time = time;
my $partcounter = 0;
for (1 .. $iterations) {
my $start = time;
my $dsr = new Data::StreamDeserializer
data => $data, block_size => $block_size;
$partcounter++ until $dsr->next;
benchmark/ds_vs_eval.pl view on Meta::CPAN
my $ds_time = time - $time;
printf " done (%3.3f seconds)\n", $ds_time;
print "\nEval statistic:\n";
printf "\t%d iterations were done\n", $iterations;
printf "\tmaximum deserialization time: %2.4f seconds\n", max(@delay);
printf "\tminimum deserialization time: %2.4f seconds\n", min(@delay);
printf "\taverage deserialization time: %2.4f seconds\n", avg(@delay);
print "\nStreamDeserializer statistic:\n";
printf "\t%d iterations were done\n", $iterations;
printf "\t%d SUBiterations were done\n", $partcounter;
printf "\t%d bytes in one block in one iteration\n", $block_size;
printf "\tmaximum deserialization time: %2.4f seconds\n", max(@delay_dsr);
printf "\tminimum deserialization time: %2.4f seconds\n", min(@delay_dsr);
printf "\taverage deserialization time: %2.4f seconds\n", avg(@delay_dsr);
printf "\taverage subiteration time: %2.5f seconds\n",
benchmark/ds_vs_eval.pl view on Meta::CPAN
usage: perl $0 [OPTIONS] test_file
OPTIONS:
-h - this helpscreen
-n count - iterations (default 1000)
-b count - bytes in one subiteration (default 512),
see perldoc Data::StreamDeserializer
hint: block_size
eof
exit 0;
view all matches for this distribution