This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env perl | |
use v5.10; | |
use strict; | |
use warnings; | |
my $delay = shift // 2; | |
my $old = 'none'; | |
while (1) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
commit eb3397a3fae7d5692bbc3766c05b7c4a8ecf6a0a | |
Author: David Golden <dagolden@cpan.org> | |
Date: Mon Apr 14 23:50:32 2014 -0400 | |
cache objects by path except for tempfile/tempdir | |
diff --git a/lib/Path/Tiny.pm b/lib/Path/Tiny.pm | |
index 9660448..42385c7 100644 | |
--- a/lib/Path/Tiny.pm | |
+++ b/lib/Path/Tiny.pm |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
BENCHMARKING foo-small | |
Rate Path::Tiny File::Slurp fast slurp | |
Path::Tiny 34133/s -- -10% -45% | |
File::Slurp 37959/s 11% -- -39% | |
fast slurp 61793/s 81% 63% -- | |
BENCHMARKING foo-med | |
Rate Path::Tiny File::Slurp fast slurp | |
Path::Tiny 10778/s -- -5% -16% | |
File::Slurp 11395/s 6% -- -11% |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env perl | |
use v5.10; | |
use strict; | |
use warnings; | |
use Benchmark qw( cmpthese ); | |
use Path::Tiny; | |
use File::Slurp qw/read_file/; | |
sub fast_slurp { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# .profile is sourced by shells after /etc/profile | |
# Flag to avoid recursion from bashrc | |
export DID_PROFILE=1 | |
# Functions to help us manage paths. Second argument is the name of the | |
# path variable to be modified (default: PATH) | |
pathremove () { | |
local IFS=':' | |
local NEWPATH |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# .bashrc | |
# For login shells, .bash_profile will source this file. | |
# For interactive non-login shells, bash sources this file directly | |
# For non-interactive shells, bash should source this file | |
# if it detects that it's running over the network (e.g. ssh) | |
# If this .bashrc is running but we're not interactive, we might be | |
# a non-interactive shell run with with --login or we might be |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
. ~/perl5/perlbrew/etc/bashrc | |
. ~/perl5/perlbrew/etc/perlbrew-completion.bash | |
__perlbrew_ps1() { | |
local printf_format="${1:-(%s)}" | |
local current=$(perlbrew list | grep \* | sed -e 's/\* //' ) | |
printf -- "$printf_format" "$current" | |
} | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ up 20.0 | |
Current perl is 20.0@std | |
$ time perl -wE 'system("perlver lib") for 1..10' > /dev/null | |
real 0m32.946s | |
user 0m32.667s | |
sys 0m0.222s | |
$ time perl -wE 'system("perlver lib") for 1..10' > /dev/null |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ up 20.0 | |
Current perl is 20.0@std | |
$ time dzil build > /dev/null | |
real 0m10.759s | |
user 0m10.369s | |
sys 0m0.337s | |
$ time dzil build > /dev/null |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
use 5.008001; | |
use strict; | |
use warnings; | |
package YAML; | |
sub Dump { YAML->new(backend => 'Old')->dump(@_) } | |
sub Load { ... } # delegate to YAML::Old | |
sub new { |