2011-11-26 121 views

回答

5

這裏的MSDN說的話 - http://msdn.microsoft.com/en-us/library/ff512758.aspx

性能考慮

使用SPMonitoredScope包裝代碼具有非常低的性能損失。但是,應該注意的是,如果由SPMonitoredScope包裝的代碼段包含執行大量迭代的循環(例如,遍歷SharePoint Foundation 2010 Web服務返回的XML節點),則調用堆棧包含在開發人員儀表板中的數據可能呈指數級增長,這使得難以破譯所顯示的信息。 最佳實踐

一種用於最佳和最有效地使用SPMonitoredScope的尖端:

All calls to external components, such as custom databases, external Web services, and so on, should be wrapped with SPMonitoredScope. This will make it easier for administrators to identify them as points of failure, and to isolate the problem quickly. 

問候, 尼丁Rastogi

1

當然有使用性能監控範圍的打擊。這就是說,它的工作負擔相對較小。最佳做法是在生產環境中將其關閉,除非您正在調查特定問題。