Monday, August 18, 2008

Better performance with declaring strings as constants?

I came across a pretty neat post by Chris Skardon about declaring strings as constants for performance. There is a margin performance increase caused by this, but it offers more of a readability benefit for other developers who would have to maintain your code.

If you're writing your code, then it might be worth putting it in for sections that would be frequently executed but if you're trying to get more performance out of hundreds of lines of old code, you're better off trying out some other optimization technique to cut down execution time.

No comments: