Can you hear the difference between 3mln/s and 24k/s ? I do not say that using hashes are good. But i'm sure that developers MUST NOT use super-slow frameworks like MooseXXXX-shit (which tries to emulate perl6 on perl5: what for???) only to get "good maintened code". That's the own problems of developers how do they organize internals. Why users of Catalyst must suffer from that ? Or you wanna tell that "good maintened code" must have a price of >100x slow down ??? that an absurdity can't you see it?
It is possible to get good code (with MIXINS, C3, etc) without such a great losses. If you see that something slows down application more than 2x why do you use it? kick it off ! Benchmark.pm is your friend! Finnaly, you are creating framework for other people and the main thing is how it looks outside, not inside. Sorry for my "hard" post, i'm just a little nervious :( 2010/4/21 J. Shirley <jshir...@gmail.com>: > On Wed, Apr 21, 2010 at 9:30 AM, Oleg Pronin <syber....@gmail.com> wrote: >> This was the last shot for me at "dealing" with catalyst. >> Catalyst is very perfomance-optimized system and it never stops me wondering >> >> timethese(-1, { >> sep => sub { $req->param('lang') }, >> all => sub { $req->params->{lang} }, >> par => sub { $req->parameters->{lang} }, >> low => sub { $req->{parameters}{lang} }, >> }); >> >> Benchmark: running all, low, par, sep for at least 1 CPU seconds... >> all: 1 wallclock secs ( 1.06 usr + 0.00 sys = 1.06 CPU) @ >> 74016.94/s (n=78643) >> low: 1 wallclock secs ( 1.09 usr + 0.00 sys = 1.09 CPU) @ >> 3816940.66/s (n=4144959) >> par: 2 wallclock secs ( 1.12 usr + 0.00 sys = 1.12 CPU) @ >> 75281.78/s (n=84692) >> sep: 1 wallclock secs ( 1.02 usr + 0.00 sys = 1.02 CPU) @ >> 24448.98/s (n=25022) >> >> >> 1) Getting all params 3x faster than only one >> 2) Getting $req->{parameters}{lang} 150x faster than $req->param('lang') >> >> Guys, is Catalyst a senior system ? >> >> I think that creator of Moose, and some similar shit is in cooperation >> with hardware manufactorers :-) >> The more CPU spent - the more hardware bought. >> > > > Maybe you should just go straight to C or assembly? > > > use Benchmark; > > my $foo = { lang => 'en', silly => 'tests', are => 'silly' }; > > sub foos { return $foo; } > sub foo { return $foo->{$_[0]}; } > > timethese(-1, { > sep => sub { foo('lang'); }, > all => sub { foos()->{lang}; }, > low => sub { $foo->{lang}; } > }); > > __END__ > Benchmark: running all, low, sep for at least 1 CPU seconds... > all: 1 wallclock secs ( 1.11 usr + 0.00 sys = 1.11 CPU) @ > 2917341.44/s (n=3238249) > low: 0 wallclock secs ( 1.27 usr + 0.04 sys = 1.31 CPU) @ > 12930179.39/s (n=16938535) > sep: 1 wallclock secs ( 1.21 usr + 0.01 sys = 1.22 CPU) @ > 3223081.15/s (n=3932159) > > Subroutines suck, lets all use hashrefs. > > (PS, your 'all' and 'par' tests are identical, as params is simply an > alias to parameters). > > _______________________________________________ > List: Catalyst@lists.scsys.co.uk > Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst > Searchable archive: http://www.mail-archive.com/catalyst@lists.scsys.co.uk/ > Dev site: http://dev.catalyst.perl.org/ > _______________________________________________ List: Catalyst@lists.scsys.co.uk Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst Searchable archive: http://www.mail-archive.com/catalyst@lists.scsys.co.uk/ Dev site: http://dev.catalyst.perl.org/