Performance of string.IndexOf(string, StringComparison.OrdinalIgnoreCase) is worse than InvariantCultureIgnoreCase - by mspi1

Status : 

  Fixed<br /><br />
		This item has been fixed in the current or upcoming version of this product.<br /><br />
		A more detailed explanation for the resolution of this particular item may have been provided in the comments section.


6
0
Sign in
to vote
ID 699078 Comments
Status Closed Workarounds
Type Bug Repros 2
Opened 11/4/2011 7:08:51 AM
Access Restriction Public
Moderator Decision Sent to Engineering Team for consideration

Description

The performance of string.IndexOf(string, StringComparison.OrdinalIgnoreCase) is about 10 times worse than string.IndexOf(string, StringComparison.InvariantCultureIgnoreCase) in a simple szenario.

According to documentation and best practice advice OrdinalIgnoreCase should be faster, e.g. http://msdn.microsoft.com/en-us/library/dd465121.aspx.
In .Net 2.0 OrdinalIgnoreCase was faster than InvariantCultureIgnoreCase, the behavior changed with .Net 4.0.

See also: 
http://social.msdn.microsoft.com/Forums/en-US/netfxbcl/thread/51c5dcc1-190a-4de7-a62f-a7d967bc517e/
http://stackoverflow.com/questions/3771030/string-comparison-in-dotnet-framework-4/3776360
Sign in to post a comment.
Posted by Microsoft on 2/10/2012 at 11:43 AM
We were able to repro this issue. The issue has been resolved and the fix will be in the next release. Thank you for you feedback.
Posted by MS-Moderator07 [Feedback Moderator] on 11/6/2011 at 10:27 PM
Thanks for your feedback.

We are rerouting this issue to the appropriate group within the Visual Studio Product Team for triage and resolution. These specialized experts will follow-up with your issue.


Posted by MS-Moderator07 on 11/6/2011 at 6:37 PM
Thank you for your feedback, We are currently reviewing the issue you have submitted. If this issue is urgent, please contact support directly (http://support.microsoft.com/)