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
free -s 0.2 | grep Mem | |
を実行して眺めつつこのperl scriptを実行すると、子プロセスがexitする時に新たなメモリを消費するのがわかる。 | |
CoWのメモリ分ではないかと思われる。 | |
キモは do と fork の組み合わせ | |
perl 5.14.4, 5.18.1で確認 | |
↓doは関係なかった | |
http://nihen.hatenablog.com/entry/2013/10/22/125410 |
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.14.0; | |
use utf8; | |
use Plack::Request; | |
use File::Basename; | |
use IO::Handle; | |
use Encode; | |
use List::Util qw/sum/; | |
use POSIX qw/strftime/; | |
use JSON::XS; | |
use Plack::Session::State::Cookie; |
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
package MyCounter; | |
sub new { my $class = shift;bless {@_} => $class } | |
sub incr { shift->{count}++ } | |
sub decr { shift->{count}-- } | |
sub count { shift->{count} } | |
package main; | |
use Text::Xslate; | |
my $tx = Text::Xslate->new( |
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 strict; | |
use warnings; | |
use Test::More; | |
use SQL::Maker::Condition; | |
my $w1 = SQL::Maker::Condition->new(); | |
$w1->add(1 => 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
perl -MO=Deparse hoge.pl | |
# インライン展開される組 | |
sub inline_q() { | |
q{myline} | |
} | |
sub inline_qq() { | |
qq{myline} | |
} |
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.14.0; | |
use Plack::Request; | |
use IO::Handle; | |
use Encode; | |
use List::Util qw/sum/; | |
use POSIX qw/strftime/; | |
use JSON::XS; | |
my $json_encoder = JSON::XS->new->latin1; | |
my $json_decoder = JSON::XS->new->utf8; |
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 strict; | |
use warnings; | |
use 5.008001; | |
use Config qw(%Config); | |
use File::Find; | |
use File::Path; | |
use JSON; | |
use Getopt::Long; | |
use version 0.77; |
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
#!perl | |
use strict; | |
use warnings; | |
use Fatal qw(open close); | |
use Test::More; | |
use File::Temp qw(tempdir); | |
use Text::Xslate; | |
{ |
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
# insert ok 1 - teng ok 2 - skinny ok 3 - dbi ok 4 - dbic # fast_insert ok 5 - teng ok 6 - skinny ok 7 - dbi ok 8 - dbic # single ok 9 - teng ok 10 - skinny ok 11 - dbi ok 12 - dbic # lookup ok 13 - teng ok 14 - skinny ok 15 - dbi ok 16 - dbic # search ok 17 - teng ok 18 - skinny ok 19 - dbi ok 20 - dbic # search_by_sql ok 21 - teng ok 22 - skinny ok 23 - dbi # dbic is not support search_by_sql # search_named ok 24 - teng ok 25 - skinny # dbi is not support search_named # dbic is not support search_named 1..25 DBI: 1.622 DBIx::Class version: 0.08200 Skinny version: 0.0742 Teng version: 0.15 --- insert --- Rate dbic teng skinny dbi dbic 941/s -- -17% -35% -45% teng 1131/s 20% -- -21% -34% skinny 1437/s 53% 27% -- -16% dbi 1706/s 81% 51% 19% -- --- fast_insert --- Rate dbic skinny teng dbi dbic 950/s -- -32% -38% -45% skinny 1399/s 47% -- -9% -19% teng 1540/s 62% 10% -- -11% dbi 172 |
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
ok 1 | |
ok 2 | |
ok 3 | |
ok 4 | |
ok 5 | |
ok 6 | |
ok 7 | |
1..7 | |
Teng version: 0.15 |
NewerOlder