in reply to Re: Session id generation with Perl once more
in thread Session id generation with Perl once more
thats rule 1, don't roll your own
Which is why I'm posting it here.
no benchmarks
You've got me on this, here's a benchmark. My proposed function is available here. (The repo is outdated, will need to check out devel branch).
#!/usr/bin/env perl use strict; use warnings; use Benchmark qw(cmpthese); use Dancer::Session::Abstract; use Apache::Session::Generate::MD5; use Catalyst::Plugin::Session; use MVC::Neaf::X::Session; $SIG{__DIE__} = \&Carp::confess; my $cat = Catalyst::Plugin::Session->new; cmpthese( -1, { dancer => \&Dancer::Session::Abstract::build_id, apache => \&Apache::Session::Generate::MD5::generate, catalyst => sub { $cat->generate_session_id }, neaf => \&MVC::Neaf::X::Session::get_session_id, });
Results of its execution on a 0.8 GHz intel laptop:
bash$ perl -Ilib bench.pl Rate dancer catalyst apache neaf dancer 4886/s -- -62% -92% -93% catalyst 12922/s 164% -- -79% -81% apache 61265/s 1154% 374% -- -12% neaf 69591/s 1324% 439% 14% --
no randomness testing
Agreed, will search for a reference for doing that.
|
|---|