[dancer-users] Dancer::Plugin::Auth::Extensible - possible backwards-incompatible change
Damien Krotkine
dkrotkine at gmail.com
Tue Dec 11 20:01:36 GMT 2012
Le mardi 11 décembre 2012 à 20:56, David Golden a écrit :
> On Tue, Dec 11, 2012 at 9:10 AM, damien krotkine <dkrotkine at gmail.com (mailto:dkrotkine at gmail.com)> wrote:
> > The only drawback is performance : there is an additional indirection, and
> > code dereferencing might be costly. The optimization of the route caching
> > stops wher your route code starts, so it won't be optimized. You don't get
> > performance hits ( or less, at least I think) with attributes.
> >
>
>
> I'm not sure it's clear cut. Right now, there is a before hook that
> runs for *every* route that has to do this:
>
> * method call to get the coderef for the route
> * function call to retrieve attributes for coderef
> * logic on attributes returned
>
Hm you're right, I had not realized it'd be for *every* route. Indeed we need more benchmark here :) But I like the attribute style. If it can help in decision making, catalyst makes use of them as well, and it's rather elegant.
>
> If only a fraction of routes require authentication, then that's a lot
> of extra overhead compared to wrapping only the subs that need it.
> And even if all routes require auth, the indirection is one call
> compared to two. The two calls might be cacheable, though, but even
> still, a single extra sub call only on routes that need it isn't too
> bad.
>
> David
>
> --
> David Golden <xdg at xdg.me (mailto:xdg at xdg.me)>
> Take back your inbox! → http://www.bunchmail.com/
> Twitter/IRC: @xdg
> _______________________________________________
> dancer-users mailing list
> dancer-users at dancer.pm (mailto:dancer-users at dancer.pm)
> http://lists.preshweb.co.uk/mailman/listinfo/dancer-users
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.preshweb.co.uk/pipermail/dancer-users/attachments/20121211/3b08de55/attachment-0001.htm>
More information about the dancer-users
mailing list