use strict; use warnings; use utf8; use lib 'lib'; use Plusen; my $p = Plusen->bootstrap({ config => { meta => { title => '鹿', author => 'Kazuhiro Osawa - ( Yappo )', email => 'yappo shibuya pl', }, plugins => [ { module => 'ScriptLoader::Simple' }, { module => 'Device::Term', }, { module => 'Device::Growl', }, ], }, }); __DATA__ === title: Shika === title: Shika.pm === title: What is Shika.pm? === title: not Shika perl mongers === title: not small Moose === title: Shika - Lightweight class builder with DSL === title: 昨日の昼ぐらいからプロジェクト開始 === title: 今は80%は出来てるはず === title: tokuhirom, yappo, mattn, typester, and more authores === title: example code code: | package Point; use Shika; has 'x';has 'y'; sub clear { my $self = shift; $self->x(0); $self->y(0); } === title: Moose? === title: ちがうよちがうよぜんぜんちがうよ === title: acme も === title: 18:25 (acme) well, also simpler === title: っていってる! === title: Shika is list: - speedy (boot time) - tiny dependency - tiny memory eat === title: Mouse? === title: Mouse is Moose compat === title: Shika is not Moose compat === title: Shika has not list: - Types - MOP - has x => ( is => 'ro') - does - meta->make_immutable - more hevy things === title: Shika has list: - has(lazy lazy_build - required default) - before, after - role(with requires) - extends - BUILD === title: Shika has (future) list: - coerce - around - meta->add_x_method_modifier - meta->add_attribute - anon class - isa (for debug) === title: どうしてShikaを作ったのか? === title: in HECon#1 list: - HTTP::Engine has problem - too much dependency - too much memory eater - hm - no Moose? === title: じゃぁMouse使えばいいじゃん === title: 結局書き直すならMoose的なのも自作した方がチューニングし易いよね === title: Mouse書き換えるよりShika作った方が楽 === title: って事でスタート === title: 早速tokuhiromがHTTP::EngineをShika化したので速度やメモリの差を見たよ === title: speed === title: on moose, 3 wallclock secs ( 2.12 usr + 0.03 sys = 2.15 CPU) @ 1512.56/s (n=3252) === title: on shika, 3 wallclock secs ( 2.10 usr + 0.03 sys = 2.13 CPU) @ 3150.23/s (n=6710) === title: on moose, make test 27.20s user 4.64s system 48% cpu 1:06.26 total === title: on shika, make test 12.98s user 3.44s system 31% cpu 51.488 total === title: 実際に make test を === title: 体感速度がだいぶちがう === title: HTTP::Engine::Interface::CGI で hello world だすだけのCGIが0.88秒から0.11秒に約8倍速 === title: memory(RSS) === title: on moose, 12832 === title: on shika, 7536 === title: tokuhiromの環境だと 8416 → 3104 と 2.7倍もちがう! === title: まとめ === title: Shika は list: - 速い - 小さい - 安い(memory cost) === title: Mooseをヘビーに使ってるHTTP::Engineで置き換えできてるからいがいといい? === title: まだまだドラフトちっくだけど、だいたいできてきてるので是非使ってみてください! === title: MENTA, Yacafi で得たノウハウを注入して === title: coderepos://lang/perl/Shika なのでtestやらcommitも! === title: Shika.pmについては以上