view release on metacpan or search on metacpan
t/152-sql-consistency.t view on Meta::CPAN
$schema->await($schema->deploy({ add_drop_table => 1 }));
subtest 'SQL consistency with default columns' => sub {
my %seen_sqls;
my $iterations = 10;
for my $i (1..$iterations) {
my $rs = $schema->resultset('User')->search({});
my $query = $rs->as_query;
my $sql = normalise_sql(extract_sql($query));
$seen_sqls{$sql}++;
}
is(scalar keys %seen_sqls, 1,
'Default column query generates consistent SQL across all iterations');
my ($sql) = keys %seen_sqls;
like($sql, qr/SELECT .+ FROM users/,
'SQL contains expected SELECT FROM structure');
t/152-sql-consistency.t view on Meta::CPAN
ok(length($columns) > 0, 'SQL contains column list');
};
subtest 'SQL consistency with explicit columns' => sub {
my %seen_sqls;
my $iterations = 10;
my @explicit_cols = qw/id name email age active settings balance/;
for my $i (1..$iterations) {
my $rs = $schema->resultset('User')->search({}, {
columns => \@explicit_cols
});
my $query = $rs->as_query;
my $sql = normalise_sql(extract_sql($query));
$seen_sqls{$sql}++;
}
is(scalar keys %seen_sqls, 1,
'Explicit column query generates consistent SQL across all iterations');
my ($sql) = keys %seen_sqls;
like($sql, qr/SELECT .+ FROM users/,
'SQL contains expected SELECT FROM structure');
view all matches for this distribution
view release on metacpan or search on metacpan
lib/DBIx/Class/EncodedColumn/Crypt/PBKDF2.pm view on Meta::CPAN
my %new_args = %$args;
# my %new_args; ## We should probably do some validation of individual args
# $new_args{hash_class} = $args->{hash_class} if exists $args->{hash_class}; ## 'HMACSHA1', 'HMACSHA3'
# $new_args{hash_args} = $args->{hash_args} if exists $args->{hash_args}; ## { sha_size => 512 }
# $new_args{iterations} = $args->{iterations} if exists $args->{iterations}; ## 1000
# $new_args{output_len} = $args->{output_len} if exists $args->{output_len}; ## 20
# $new_args{salt_len} = $args->{salt_len} if exists $args->{salt_len}; ## 4
# $new_args{encoding} = $args->{encoding} if exists $args->{encoding}; ## 'ldap'
# $new_args{length_limit} = $args->{length_limit} if exists $args->{length_limit};
lib/DBIx/Class/EncodedColumn/Crypt/PBKDF2.pm view on Meta::CPAN
data_type => 'text',
encode_column => 1,
encode_class => 'Crypt::PBKDF2',
encode_args => {
hash_class => 'HMACSHA1',
iterations => 1000
},
encode_check_method => 'check_password',
}
)
lib/DBIx/Class/EncodedColumn/Crypt/PBKDF2.pm view on Meta::CPAN
B<Type:> Object (must fulfill role L<Crypt::PBKDF2::Hash>), B<Default:> None.
It is also possible to provide a hash object directly; in this case the
C<hash_class> and C<hash_args> are ignored.
=head2 iterations
B<Type:> Integer, B<Default:> 1000.
The default number of iterations of the hashing function to use for the
C<generate> and C<PBKDF2> methods.
=head2 output_len
B<Type:> Integer.
view all matches for this distribution
view release on metacpan or search on metacpan
lib/DBIx/Class/Migration/Tutorial.pod view on Meta::CPAN
test cases for your database.
=head2 STEP 5: Third Migration
L<DBIx::Class::Migration::Tutorial::ThirdMigration> explores a more complicated
migration and also reviews what to do if you need to run through a few iterations
of a migration before you are ready to set it in stone.
=head2 STEP 6: Migrations for Additional Databases
L<DBIx::Class::Migration::Tutorial::AddMySQL>. So far we've been building
view all matches for this distribution
view release on metacpan or search on metacpan
lib/DBIx/Class/Sims/Item.pm view on Meta::CPAN
return;
}
}
# Search through all the possible iterations of unique keys.
# * Don't populate $self->{create}
# * If found with all keys, great.
# * Otherwise, keep track of what we find for each combination (if at all)
# * If we have multiple finds, die.
# TODO: Use List::Powerset->powerset_lazy() instead of powerset()
view all matches for this distribution
view release on metacpan or search on metacpan
This method is used for iterating through multiple database entries. See
_prepare_sql for the named parameters used.
You must pass as the first arguement a reference to a scalar to store an
id for the iteration. This allows iterations to be nested without
conflict.
=cut
sub each {
view all matches for this distribution
view release on metacpan or search on metacpan
DataLoader/XMLWriter.pm view on Meta::CPAN
XMLWriter expects to get hash referance to a hash that contains
a hash keyed to table names, with each table key's value is a hash
containing a data hash and keys for (parent, xpath, and node);
The data hash will contain all data for a given segment of xml.
The hash is keyed by numbers that are based on the number of iterations
of data contained in the hash. Each number key points to a array of hash which
contain the actual data, item_node, xpath, and a attribute. Only the attribute node is
optional.
view all matches for this distribution
view release on metacpan or search on metacpan
ddc-query.perl view on Meta::CPAN
'opt-file|opt|O=s' => \$client{optFile},
'mode|m=s' => \$client{mode},
'query-encoding|qencoding|qe=s' => \$qencoding,
##-- Benchmarking and testing
'benchmark-iterations|benchmark-iters|bench-iters|bibenchmark|bench|b|iters|i=i' => \$bench_iters,
'benchmark-seconds|bench-seconds|bs=i' => \$bench_seconds,
'bench-clear-cache|bench-clear|bc!' => \$bench_clear_cache,
'query-file|file|qf!' => \$query_from_file,
'query-sleep|sleep|qs=i' => \$query_sleep,
'query-verbose|qv|verbose|query-trace|qt|trace!' => \$query_verbose,
ddc-query.perl view on Meta::CPAN
-file ##-- arguments are query-list filenames, not queries
-request ##-- alias for -mode=request -raw (for protocol debugging)
-multi ##-- send multiple requests on same connection (default=no)
Benchmarking and Batch Options:
-bench-iters ITERS ##-- benchmark: time ITERS query iterations
-bench-seconds SECONDS ##-- benchmark: abort after SECONDS query-processing time (default=inf)
-[no]bench-clear ##-- do/don't clear server cache between benchmark iterations (default=do)
-query-file ##-- batch-execute queries from command-line argument file(s)
-query-sleep SECONDS ##-- sleep for SECONDS between multiple queries (default=0)
-query-verbose ##-- trace query execution to stderr
Hit Selection Options:
view all matches for this distribution
view release on metacpan or search on metacpan
eval { $pair->[1]->() };
if ($@) { warn " $pair->[0] failed to parse: $@"; $ok = 0 }
}
unless ($ok) { print " (skipped: parse failure)\n\n"; next }
# Auto-tune iteration count: more iterations for faster fixtures.
cmpthese(-2, {
pure => sub { DMS::Parser::parse_document_with_config($src, $pure_cfg) },
xs => sub { DMS::Parser::XS::parse_document_with_config($src, $xs_cfg) },
});
print "\n";
view all matches for this distribution
view release on metacpan or search on metacpan
lib/DMS/Parser.pm view on Meta::CPAN
$self->{line_start} = $self->{pos};
}
$self->_skip_trivia;
last if $self->{pos} >= $self->{len};
# Inline _measure_line_indent: hot enough that the call cost
# matters across 50k iterations. For indent==0 (most flat
# tables) we can skip the regex when pos is already at
# line_start with no leading space â by far the common case.
my $li;
if ($indent == 0 && $self->{pos} == $self->{line_start}
&& substr($self->{src}, $self->{pos}, 1) ne ' ') {
view all matches for this distribution
view release on metacpan or search on metacpan
eval { $pair->[1]->() };
if ($@) { warn " $pair->[0] failed to parse: $@"; $ok = 0 }
}
unless ($ok) { print " (skipped: parse failure)\n\n"; next }
# Auto-tune iteration count: more iterations for faster fixtures.
cmpthese(-2, {
pure => sub { DMS::Parser::parse_document_with_config($src, $pure_cfg) },
xs => sub { DMS::XS::Parser::parse_document_with_config($src, $xs_cfg) },
});
print "\n";
view all matches for this distribution
view release on metacpan or search on metacpan
lib/DNS/LDNS.pm view on Meta::CPAN
str = pkt_rcode2str(rcode)
error = errorstr_by_id(status)
str = DNS::LDNS::last_error
status = DNS::LDNS::last_status
rr = dnssec_create_nsec(from, to, type)
rr = dnssec_create_nsec3(from, to, algorithm, flags, iterations, salt)
rr = create_nsec(current, next, rrs)
rr = create_nsec3(cur_owner, cur_zone, algorithm, flags,
iterations, salt, empty_nonterminals)
algo = signing_algorithm_by_name(name)
bool = key_algorithm_supported(algorithm)
rr = read_anchor_file(filename)
=head2 Object references and cloning
view all matches for this distribution
view release on metacpan or search on metacpan
rtree/salad/rtree.h view on Meta::CPAN
/** Maximal possible R-tree height */
RTREE_MAX_DIMENSION = 20
};
/**
* Rtree search operations. Used for searching and iterations.
* All operations except SOP_ALL reqires a rectangle to be set,
* and treat it in different ways
*/
enum spatial_search_op
{
view all matches for this distribution
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