泣いてるperl。
気になってたので、メモ。
でも、まだまともな計測じゃないと思うので
あくまで、メモ。
・php
[anigon@localhost compare]$ php -vPHP 5.2.6 (cli) (built: Aug 29 2008 20:56:15)
Copyright (c) 1997-2008 The PHP Group
Zend Engine v2.2.0, Copyright (c) 1998-2008 Zend Technologies
time php -r 'for ($i = 0; $i < 100; $i++) {echo "hello\n";}'
10回計測した平均。
real 0m0.434s
user 0m0.042s
sys 0m0.180s
・perl
[anigon@localhost compare]$ perl -vThis is perl, v5.8.5 built for i386-linux-thread-multi
Copyright 1987-2004, Larry Wall
Perl may be copied only under the terms of either the Artistic License or the
GNU General Public License, which may be found in the Perl 5 source kit.
Complete documentation for Perl, including FAQ lists, should be found on
this system using `man perl' or `perldoc perl'. If you have access to the
Internet, point your browser at http://www.perl.com/, the Perl Home Page.
time perl -e 'for ($i = 0; $i < 100; $i++) {print "hello\n";}'
10回計測した平均。
real 0m0.315s
user 0m0.012s
sys 0m0.111s
まだまだ実験が足りないけど、
会社じゃ周りが「perlは遅いからphpに移植します」って言ってるので
その根拠を知りたくて、試してみたいと思っとりましたー。
と言うか、どんな言語で書いたって
メモリの事、考えないで書いてたんじゃ遅くわなるわなー...と
思うのは私だけだろうか。
うー、perlって日本語みたいに曖昧な言葉を
いろんな組み合わせに出来ちゃうような
ふわふわした雰囲気が好きなんだけどなぁ。
勿論、Javaのごちゃごちゃしたパーツの組み合わせの
合体ロボみたいなのも、それもそれで面白いし、
ちらしの裏にメモ程度に書いたラフな感じでも動いてくれちゃうphpも
電子レンジみたいでお手軽で有難い。
言語に限らず何でもそうだけど、
それぞれ良さがあって、それぞれ欠点があるのに
perlだけ悪者扱いされてるのが、悲しくてしょうがない今日この頃です。