ResourceManager.GetString() Vs SPUtility.GetLocalizedString() in sharePoint.

sharePointIn a sharePoint application we can retrieve resource file data from two methods.

1. ResourceManager.GetString(): Which is the API provided by .Net.

2.SPUtility.GetLocalizedString():This method is provided by the sharePoint API in Microsoft.SharePoint.Utilities.

To test the performance of these two methods-

1. First we created a visual web part and put two labels in it.

2.Then we fetched 1,000 strings from same resource file using both methods and found that SPUtility.GetLocalizedString() method  is five times faster than ResourceManager.GetString() method.

After de-compiling the assemblies, i found one interesting thing that  SPUtility.GetLocalizedString() method cached the whole resource file and each time when we have query via SPUtility.GetLocalizedString() method , it will return localized data from cache.
Share on Google Plus

About JK STACK

This is a short description in the author block about the author. You edit it by entering text in the "Biographical Info" field in the user admin panel.

1 comments:

  1. Do you know why i like this website? I like this website because of great and update info. I also like Sharing-and-Visibility-Designer braindumps because now they are writing quality content for the student. I am very proud for that.

    ReplyDelete