Recently we had a strange support call regarding our rating solution.
The customer experienced very bad performance using our rating field type, when opening the comments page for an item.
everything else was working very fast, pages loaded within a blink of an eye, only opening the popup that displays the comments and ratings from other users took anywhere from 10 to 40 seconds...
So, we created a debug version that prints out the time stamp of every stage of the page.
What the page does is basically, load all comments and ratings into a list and binds them into a repeater control.
So, we found out that while loading the comments we get the user login name, and since we want to show the user display name we use this SharePoint API method to get the display name from the login name:
well, to keep it simple, calling the method above to get the user display name took 8 seconds every time we called it, so for every comment on the item the page load time would take 8 more seconds!!!
The customer opened a support call to microsoft while we were investigating other alternatives for getting the user display name.
The answer the customer got from microsoft team was simple and did resolve the issue.
Simply instead of using SPUtility.GetFullNameFromLogin, they recommend using:
so, the web.EnsureUser method works much faster and the performance problem was resolved!
Since I did not see any post about this on the web I thought I might as well write one myself - hope this helps some of you in the future.