Skip to content

Instantly share code, notes, and snippets.

View exodist's full-sized avatar

Chad Granum exodist

View GitHub Profile
@exodist
exodist / 100000ok.log
Created January 6, 2016 05:24
100,000 OK test benchmarks
Test2
1.59s user 0.02s system 99% cpu 1.616 total
1.59s user 0.03s system 100% cpu 1.618 total
1.62s user 0.02s system 100% cpu 1.640 total
1.62s user 0.02s system 100% cpu 1.637 total
1.61s user 0.01s system 100% cpu 1.615 total
Test::Builder (stable)
3.74s user 0.08s system 99% cpu 3.842 total
3.77s user 0.05s system 100% cpu 3.818 total
package Test2::Util::HashBase;
use strict;
use warnings;
my %ATTRS;
my %META;
sub _get_inherited_attrs {
my @todo = @_;
my %seen;
sub _get_all_attrs {
my @todo = @_;
my %seen;
my @all;
while (my $pkg = shift @todo) {
next if $seen{$pkg}++;
my $found = $META{$pkg};
push @all => @$found if $found;
no strict 'refs';
@exodist
exodist / test.pl
Created December 15, 2015 19:42
uhg...
use strict;
use warnings;
local $! = 100;
print '$! == ' . int($!) . "\n";
{
local $! = $!;
print '$! == ' . int($!) . "\n";
dup(1) = 3
ioctl(3, SNDCTL_TMR_TIMEBASE or SNDRV_TIMER_IOCTL_NEXT_DEVICE or TCGETS, {B38400 opost isig icanon echo ...}) = 0
lseek(3, 0, SEEK_CUR) = -1 ESPIPE (Illegal seek)
fstat(3, {st_mode=S_IFCHR|0620, st_rdev=makedev(136, 4), ...}) = 0
fcntl(3, F_SETFD, FD_CLOEXEC) = 0
ioctl(3, SNDCTL_TMR_TIMEBASE or SNDRV_TIMER_IOCTL_NEXT_DEVICE or TCGETS, {B38400 opost isig icanon echo ...}) = 0
lseek(3, 0, SEEK_CUR) = -1 ESPIPE (Illegal seek)
dup(2) = 4
ioctl(4, SNDCTL_TMR_TIMEBASE or SNDRV_TIMER_IOCTL_NEXT_DEVICE or TCGETS, {B38400 opost isig icanon echo ...}) = 0
lseek(4, 0, SEEK_CUR) = -1 ESPIPE (Illegal seek)
@exodist
exodist / results
Created November 23, 2015 23:05
Moose tests
Current cpan dev release of Test-More + Test-Stream/master
Files=472, Tests=19125, 86 wallclock secs ( 2.73 usr 0.47 sys + 79.60 cusr 5.08 csys = 87.88 CPU)
Files=472, Tests=19125, 86 wallclock secs ( 2.73 usr 0.47 sys + 80.09 cusr 5.26 csys = 88.55 CPU)
Files=472, Tests=19125, 88 wallclock secs ( 2.73 usr 0.49 sys + 81.29 cusr 5.22 csys = 89.73 CPU)
Current cpan dev release of Test-More + Test-Stream/tap_rework - using index()
Files=472, Tests=19125, 85 wallclock secs ( 2.75 usr 0.45 sys + 79.67 cusr 5.07 csys = 87.94 CPU)
Files=472, Tests=19125, 86 wallclock secs ( 2.75 usr 0.43 sys + 79.51 cusr 4.96 csys = 87.65 CPU)
Files=472, Tests=19125, 87 wallclock secs ( 2.71 usr 0.51 sys + 80.60 cusr 5.23 csys = 89.05 CPU)
@exodist
exodist / test.pl
Created November 23, 2015 21:49
perofrmance
use strict;
use warnings;
use Time::HiRes qw/time/;
use Scalar::Util qw/blessed/;
use List::Util qw/max/;
my $runs = 1_000_000;
@exodist
exodist / OO.pm
Created November 13, 2015 20:22
Test::Stream::Plugin::OO
package Test::Stream::Plugin::OO;
use strict;
use warnings;
use Carp qw/confess croak/;
use Test::Stream::Plugin;
use Test::Stream::Plugin::OO::Base;
use Test::Stream::Util qw/pkg_to_file/;
<Exodist> https://metacpan.org/pod/distribution/Test-Stream/lib/Test/Stream/Manual/FromTestBuilder.pod
was updated to reference the -Classic bundle, is_deeply and classic 'is' are int he classic bundle.
also cmp_ok is back.
<Exodist> let them chill on git for a week, then put them in a trial for a few days, now they are out.
<rjbs> github and chill
<Exodist> haha
<mohawk> well played!
[...]
<jberger> rjbs: I hope you're using (ssl) protection
use Test::Stream -V1;
is(
[
{a => 1, b => 2},
"x"
],
[
{a => "one", b => "two"},
"y"
],