Some test portability fixes again + minor changes
This commit is contained in:
parent
3fd424c6e3
commit
f09a103c53
7 changed files with 33 additions and 28 deletions
4
FU/Pg.pm
4
FU/Pg.pm
|
|
@ -666,8 +666,8 @@ module does not.
|
||||||
|
|
||||||
Converted between floating point seconds since C<00:00:00>, supporting
|
Converted between floating point seconds since C<00:00:00>, supporting
|
||||||
microsecond precision. This format allows for easy comparison against Unix
|
microsecond precision. This format allows for easy comparison against Unix
|
||||||
timestamps (time of day = C<$timestamp % 86400>) and can be added to an integer
|
timestamps (time of day in UTC = C<$timestamp % 86400>) and can be added to an
|
||||||
date value to form a complete timestamp.
|
integer date value to form a complete timestamp.
|
||||||
|
|
||||||
(There's no support for the string format yet)
|
(There's no support for the string format yet)
|
||||||
|
|
||||||
|
|
|
||||||
16
Makefile.PL
16
Makefile.PL
|
|
@ -2,7 +2,7 @@ use ExtUtils::MakeMaker;
|
||||||
use Config;
|
use Config;
|
||||||
|
|
||||||
os_unsupported if $^O eq 'MSWin32'; # I don't know on which OS'es the code will work exactly, but this one I can easily rule out.
|
os_unsupported if $^O eq 'MSWin32'; # I don't know on which OS'es the code will work exactly, but this one I can easily rule out.
|
||||||
os_unsupported if $Config{ivsize} < 8;
|
os_unsupported if $Config{ptrsize} < 8;
|
||||||
os_unsupported if $Config{usequadmath};
|
os_unsupported if $Config{usequadmath};
|
||||||
|
|
||||||
WriteMakefile(
|
WriteMakefile(
|
||||||
|
|
@ -15,12 +15,16 @@ WriteMakefile(
|
||||||
MIN_PERL_VERSION => 'v5.36',
|
MIN_PERL_VERSION => 'v5.36',
|
||||||
META_MERGE => {
|
META_MERGE => {
|
||||||
dynamic_config => 0,
|
dynamic_config => 0,
|
||||||
|
'meta-spec' => { version => 2 },
|
||||||
resources => {
|
resources => {
|
||||||
repository => 'https://code.blicky.net/yorhel/fu',
|
repository => {
|
||||||
bugtracker => 'https://code.blicky.net/yorhel/fu/issues',
|
web => 'https://code.blicky.net/yorhel/fu',
|
||||||
},
|
type => 'git',
|
||||||
no_index => {
|
},
|
||||||
file => 'bench.PL',
|
bugtracker => {
|
||||||
|
web => 'https://code.blicky.net/yorhel/fu/issues',
|
||||||
|
mailto => 'projects@yorhel.nl',
|
||||||
|
},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
depend => { '$(OBJECT)', 'c/*.c' },
|
depend => { '$(OBJECT)', 'c/*.c' },
|
||||||
|
|
|
||||||
20
bench.PL
20
bench.PL
|
|
@ -223,6 +223,7 @@ sub fmtbench($id, $text, $xs, $ys) {
|
||||||
open my $F, '>FU/Benchmarks.pod' or die $!;
|
open my $F, '>FU/Benchmarks.pod' or die $!;
|
||||||
select $F;
|
select $F;
|
||||||
while (<DATA>) {
|
while (<DATA>) {
|
||||||
|
s/^%/=/;
|
||||||
s#^:modules#join '', map sprintf("=item L<%s> %s\n\n", $_, $modules{$_}), sort keys %modules#e;
|
s#^:modules#join '', map sprintf("=item L<%s> %s\n\n", $_, $modules{$_}), sort keys %modules#e;
|
||||||
s#^:benches (.+)#join '', map fmtbench(@$_), grep $_->[0] =~ /$1/, @bench#e;
|
s#^:benches (.+)#join '', map fmtbench(@$_), grep $_->[0] =~ /$1/, @bench#e;
|
||||||
print;
|
print;
|
||||||
|
|
@ -233,12 +234,13 @@ sub fmtbench($id, $text, $xs, $ys) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
# s/^=/%/ to prevent tools from interpreting the below as POD
|
||||||
__DATA__
|
__DATA__
|
||||||
=head1 NAME
|
%head1 NAME
|
||||||
|
|
||||||
FU::Benchmarks - A bunch of automated benchmark results.
|
FU::Benchmarks - A bunch of automated benchmark results.
|
||||||
|
|
||||||
=head1 DESCRIPTION
|
%head1 DESCRIPTION
|
||||||
|
|
||||||
This file is automatically generated from 'bench.PL' in the L<FU> distribution.
|
This file is automatically generated from 'bench.PL' in the L<FU> distribution.
|
||||||
These benchmarks compare performance of some FU functionality against similar
|
These benchmarks compare performance of some FU functionality against similar
|
||||||
|
|
@ -256,19 +258,19 @@ real-world use.
|
||||||
B<DISCLAIMER#3:> Many of these benchmarks exists solely to test edge case
|
B<DISCLAIMER#3:> Many of these benchmarks exists solely to test edge case
|
||||||
performance, these numbers are not representative for real-world use.
|
performance, these numbers are not representative for real-world use.
|
||||||
|
|
||||||
=head1 MODULE VERSIONS
|
%head1 MODULE VERSIONS
|
||||||
|
|
||||||
The following module versions were used:
|
The following module versions were used:
|
||||||
|
|
||||||
=over
|
%over
|
||||||
|
|
||||||
:modules
|
:modules
|
||||||
|
|
||||||
=back
|
%back
|
||||||
|
|
||||||
=head1 BENCHMARKS
|
%head1 BENCHMARKS
|
||||||
|
|
||||||
=head2 JSON Parsing & Formatting
|
%head2 JSON Parsing & Formatting
|
||||||
|
|
||||||
These benchmarks run on large-ish arrays with repeated values. JSON encoding is
|
These benchmarks run on large-ish arrays with repeated values. JSON encoding is
|
||||||
sufficiently fast that Perl function calling overhead tends to dominate for
|
sufficiently fast that Perl function calling overhead tends to dominate for
|
||||||
|
|
@ -279,10 +281,10 @@ SIMD parts are only used for parsing.
|
||||||
|
|
||||||
:benches ^json
|
:benches ^json
|
||||||
|
|
||||||
=head2 XML Writing
|
%head2 XML Writing
|
||||||
|
|
||||||
:benches ^xml
|
:benches ^xml
|
||||||
|
|
||||||
=cut
|
%cut
|
||||||
|
|
||||||
# Cached data used by bench.PL. Same as the formatted tables above but easier to parse.
|
# Cached data used by bench.PL. Same as the formatted tables above but easier to parse.
|
||||||
|
|
|
||||||
|
|
@ -488,7 +488,7 @@ static void fupg_refresh_types(pTHX_ fupg_conn *c) {
|
||||||
t->send = fupg_send_text;
|
t->send = fupg_send_text;
|
||||||
t->recv = fupg_recv_text;
|
t->recv = fupg_recv_text;
|
||||||
} else {
|
} else {
|
||||||
/* TODO: (multi)ranges, custom overrides, by-name lookup for dynamic-oid types */
|
/* TODO: (multi)ranges, by-name lookup for dynamic-oid types */
|
||||||
const fupg_type *builtin = fupg_builtin_byoid(t->oid);
|
const fupg_type *builtin = fupg_builtin_byoid(t->oid);
|
||||||
if (builtin) {
|
if (builtin) {
|
||||||
t->send = builtin->send;
|
t->send = builtin->send;
|
||||||
|
|
@ -571,11 +571,8 @@ static void fupg_tio_setup(pTHX_ fupg_conn *conn, fupg_tio *tio, int flags, Oid
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Minor wart? When the type is overridden by oid, the name & oid in error
|
/* Minor wart? When the type is overridden by oid, its name in error
|
||||||
* messages will be that of the builtin type. When overridden by name, the
|
* messages will be that of the builtin type instead of the actual type. */
|
||||||
* name will be correct but the oid is still of the builtin type.
|
|
||||||
* Some send/recv functions have slightly different behavior based on oid,
|
|
||||||
* in those cases this behavior is useful. */
|
|
||||||
|
|
||||||
SV *cb = NULL;
|
SV *cb = NULL;
|
||||||
const fupg_type *e, *t;
|
const fupg_type *e, *t;
|
||||||
|
|
|
||||||
|
|
@ -456,8 +456,8 @@ RECVFN(perlcb) {
|
||||||
call_sv(ctx->cb, G_SCALAR);
|
call_sv(ctx->cb, G_SCALAR);
|
||||||
SPAGAIN;
|
SPAGAIN;
|
||||||
|
|
||||||
SV *ret = newSV(0);
|
SV *ret = POPs;
|
||||||
sv_setsv(ret, POPs);
|
SvREFCNT_inc(ret);
|
||||||
PUTBACK;
|
PUTBACK;
|
||||||
|
|
||||||
FREETMPS;
|
FREETMPS;
|
||||||
|
|
|
||||||
|
|
@ -55,7 +55,7 @@ my @tests = (
|
||||||
''.$$, '"'.$$.'"',
|
''.$$, '"'.$$.'"',
|
||||||
do { my $x = 12; utf8::decode($x); $x }, '"12"',
|
do { my $x = 12; utf8::decode($x); $x }, '"12"',
|
||||||
do { no warnings 'numeric'; my $x = '19a'; $x += 0; $x }, '19',
|
do { no warnings 'numeric'; my $x = '19a'; $x += 0; $x }, '19',
|
||||||
1844674407370955161 / 10, $Config{uselongdouble} ? 184467440737095516 : '1.84467440737096e+17',
|
$Config{uselongdouble} ? () : ( 1844674407370955161 / 10, '1.84467440737096e+17' ),
|
||||||
);
|
);
|
||||||
|
|
||||||
my @errors = (
|
my @errors = (
|
||||||
|
|
|
||||||
|
|
@ -97,8 +97,10 @@ num ' -0 ', 0;
|
||||||
num '-9223372036854775808';
|
num '-9223372036854775808';
|
||||||
num '9223372036854775807';
|
num '9223372036854775807';
|
||||||
num '18446744073709551615';
|
num '18446744073709551615';
|
||||||
num '-9223372036854775809', $Config{uselongdouble} ? -9.22337203685477581e+18 : -9.22337203685478e+18;
|
if (!$Config{uselongdouble}) { # Behavior of longdouble is architecture-dependent
|
||||||
num '18446744073709551616', $Config{uselongdouble} ? 1.84467440737095516e+19 : 1.84467440737096e+19;
|
num '-9223372036854775809', -9.22337203685478e+18;
|
||||||
|
num '18446744073709551616', 1.84467440737096e+19;
|
||||||
|
}
|
||||||
num '1.234';
|
num '1.234';
|
||||||
num '1e5', 100000;
|
num '1e5', 100000;
|
||||||
num '1e+5', 100000;
|
num '1e+5', 100000;
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue