[dancer-users] Dancer::Plugin::Auth::Extensible - possible backwards-incompatible change

David Golden xdg at xdg.me
Tue Dec 11 19:56:55 GMT 2012


On Tue, Dec 11, 2012 at 9:10 AM, damien krotkine <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

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>
Take back your inbox! → http://www.bunchmail.com/
Twitter/IRC: @xdg


More information about the dancer-users mailing list