-
Notifications
You must be signed in to change notification settings - Fork 805
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Use new String.Join overload added in .Net 4.0 (~3x faster) #2570
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice, eliminating that copy is a good thing.
Really probably inconsequential, but not sure if this was a good change or not. Under the hood, because it's a
You find that the upfront |
@manofstick never thought of that - it's probably worth graphing size vs speed so then we can figure out a tradeoff and optimise for what we believe is the most common case. |
I mean Oh, and I would avoid |
Oh, and I would probably avoid using the
Is probably best |
@manofstick with your latest code, here are the benchmarks I get:
|
OK, now play around with some different strings :-) Have fun! |
More effort than I really think this is probably worth (I think the change as stands is good and I don't think you should change it, my discussion is more just on the joys of optimizing things...) anyway, I played a little more and present this:
Which seems to indicate that the benefit of going to an array kicks in with strings than are greater than 20 to 30 characters. |
Fixes #2569
Before this PR: 880 msecs
With this PR: 300 msecs
Benchmark script: