Skip to content

Instantly share code, notes, and snippets.

View exodist's full-sized avatar

Chad Granum exodist

View GitHub Profile
# Start
in1---->[]---->fan
in2---->[]---->light
# BAD
in1---->[]---->light
in2---->[]---->fan
# Good
in2---->[]---->light
@exodist
exodist / test.pl
Created May 30, 2016 14:50
minimal inline testing
sub ok($;$) {$_[0] || $T::FAIL++; print( ($_[0] ? "ok " : "not ok ") . ++$T::NUM . ($_[1] ? " - $_[1]\n" : "\n"))}
sub done_testing { print "1..$T::NUM\n" }
END { $? ||= $T::FAIL; $? = 255 if $? > 255 }
@exodist
exodist / harness comparisons
Created May 25, 2016 00:12
Harness Comparison
Test::Harness (-j9):
180.89s user 10.68s system 340% cpu 56.340 total
Yath No Preload (-j9):
197.49s user 11.62s system 343% cpu 1:00.84 total
Yath Preload Moose (-j9):
96.71s user 16.82s system 321% cpu 35.332 total
NO TAINT
Files=721, Tests=8937, 1178 wallclock secs ( 6.11 usr 1.45 sys + 1216.61 cusr 354.40 csys = 1578.57 CPU)
Result: PASS
prove -Ilib -r t/unit/ 1222.84s user 355.87s system 134% cpu 19:37.50 total
WITH TAINT
Files=721, Tests=8930, 1177 wallclock secs ( 6.19 usr 1.41 sys + 1212.20 cusr 356.12 csys = 1575.92 CPU)
Result: FAIL
prove -Ilib -r t/unit/ 1218.54s user 357.55s system 133% cpu 19:36.48 total
@exodist
exodist / 
Created April 23, 2016 11:49
cgi-speedy
cpanm (App::cpanminus) 1.7040 on perl 5.020003 built for x86_64-linux-thread-multi
Work directory is /home/exodist/.cpanm/work/1461412129.15680
You have make /usr/bin/make
You have LWP 6.15
You have /usr/bin/tar: tar (GNU tar) 1.28
Copyright (C) 2014 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>.
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.
prove2 -j9 -LMoose t 61.95s user 11.15s system 332% cpu 21.973 total
prove2 -j9 t 175.76s user 18.00s system 356% cpu 54.372 total
prove -j9 -r t 169.45s user 10.21s system 358% cpu 50.083 total
use B;
END { print "a\n"; }
my $endav;
BEGIN { $endav = B::end_av->object_2svref; }
{
package RetieEndav;
sub DESTROY { tie @$endav, "TiedEndav" }
}
exodist@abydos $ perlbrew list [~]
5.8.1_no_thr
5.8.1_thr
5.8.8_no_thr
5.8.8_thr
5.10.0_no_thr
5.10.0_thr
5.12.0_no_thr
5.12.0_thr
5.14.0_no_thr
my $tmpdir = File::Temp::tempdir('foo-XXXXXX', CLEANUP => 0, TMPDIR => 1);
Error in tempdir() using /tmp/foo-XXXXXX: Could not create directory /tmp/foo-xOzGma: File exists at
@exodist
exodist / ipc.pl
Last active February 21, 2016 20:25
use strict;
use warnings;
use Test2::IPC;
use Test::More;
for (1 .. 2) {
Test2::API::run_subtest(foo => sub {
my $pid = fork();