On 9/29/07, Craig Andera <[EMAIL PROTECTED]> wrote: > > You're right about catch being expensive. It appears to use an > > additional 40 - 60 ms. the good news is that it is not a percentage so > > the added time on long running pages is sometimes on the lower end. > > > > If there is any other way I would use it, but the code that throws the > > FlexWikiAuthorizationException has no understanding of the context it > > was called in, which is the correct design. > > Well, you can call HasPermission for every topic, and not attempt operations > on which you don't have Read. It adds overhead of its own, of course, but > probably not a ton - HasPermission is cached both at the per-request and at > the topic level. Using the usual 1000x exception rule of thumb, it's > probably worth it most of the time. > >
I'm not sure what the 1000x exception rule of thumb is, but with heavy use of authorization on "select *" type wikitalk statement, I'd say that you could end up with more exceptions than not. I worry that this will end up causing performance problems. Think about the numbers that John found.... 50 ms per exception on wikitalk that selects just 20 pages (which is just plain tiny) can add a full second. That seems like way too much to ignore. I think that the HasPermission check would be better for the average case. I, of course, have no numbers to back this up, just some experience at having made this exact mistake before. -nathan ------------------------------------------------------------------------- This SF.net email is sponsored by: Microsoft Defy all challenges. Microsoft(R) Visual Studio 2005. http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/ _______________________________________________ Flexwiki-users mailing list Flexwiki-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/flexwiki-users