Search

String.Concat Slow in .NET 4.5 by Ehrys

Active

2
0
Sign in
to vote
Type: Bug
ID: 780770
Opened: 3/6/2013 2:40:20 AM
Access Restriction: Public
0
Workaround(s)
1
User(s) can reproduce this bug

When analysing the performance of different String manipulation methods, String.Concat came out drastically slower than the same code compiled for .NET 3.5

Please see this article I wrote: http://www.daniweb.com/software-development/csharp/code/448050/performance-of-string-operations

It seems to be the way that the IL is generated. It is subtly different to the same code compiled for .NET 3.5. Why does the same level of optimisation no longer apply in 4.5?
Details (expand)

Visual Studio/Team Foundation Server/.NET Framework Tooling Version

.NET Framework 4.5

Steps to reproduce


See code written in the article. Compile and run using standard settings in release mode.

Product Language

English

Operating System

Windows 7

Operating System Language

English

Actual results


Actual results are that operations using String.Concat are incredibly slow compared to other ways of performing concatenation (StringBuilder and new String)

Expected results


String.Concat should not exhibit the drastic performance drop compared to the other operations.
File Attachments
0 attachments
Sign in to post a comment.
Posted by Microsoft on 3/27/2013 at 11:12 AM
Thank you for your feedback. We are not going to be able to address this issue in our next release due to other priorities.

You can workaround the issue by casting the string to object.

Regards,
Immo Landwerth
.NET Framework team
Posted by Microsoft on 3/6/2013 at 9:41 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 Microsoft on 3/6/2013 at 2:50 AM
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)
Sign in to post a workaround.