Le mardi 11 décembre 2012 à 20:56, David Golden a écrit :
On Tue, Dec 11, 2012 at 9:10 AM, damien krotkine <dkrotkine@gmail.com> wrote:The only drawback is performance : there is an additional indirection, andcode dereferencing might be costly. The optimization of the route cachingstops wher your route code starts, so it won't be optimized. You don't getperformance hits ( or less, at least I think) with attributes.I'm not sure it's clear cut. Right now, there is a before hook thatruns 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 lotof extra overhead compared to wrapping only the subs that need it.And even if all routes require auth, the indirection is one callcompared to two. The two calls might be cacheable, though, but evenstill, a single extra sub call only on routes that need it isn't toobad.David--David Golden <xdg@xdg.me>Take back your inbox! → http://www.bunchmail.com/Twitter/IRC: @xdg_______________________________________________dancer-users mailing list