CAuthZcontext and slow search
I have been working on a SharePoint 2010 farm deployment and came across a problem with the performance of SharePoint search. I was finding that it was consistently taking more than 15 seconds to return search results. As part of the troublshooting process, I turned on verbose logging in SharePoint and was able to identify the 15 second gap was between these two entries:
0x0138 12:38:40.33 init CAuthZcontext
0x0138 12:38:55.41 finished init CauthZContext
There was no reference to this anywhere on Google or Bing. I could not find any documentation.
I went to the extent of rebuilding the farm twice on different servers with different SQL instances. It was as simple as you can get with a Team Site collection and search center, about 5 documents in the document library. The problem persisted on both farms.
Thanks to @weshackett for suggesting I try enabling Claims for the web application hosting the document library. I did this and after resolving the subsequent Access Denied error by resetting the site collection administrator and recrawling the content, the performance went back to what I would expect.
It is still a bit of a mystery to me at present as to why Search was trying to use Claims authorisation for security trimming the results. If I find out, I will post the reason here.