关于StringBuilder和String的效率问题。
下面是测试。
2006-07-21 11:42:18,734 - TestString(Length=9,Count=100) Spent Time(ms)=16
2006-07-21 11:42:23,312 - TestString(Length=9,Count=1000) Spent Time(ms)=31
2006-07-21 11:42:25,687 - TestString(Length=9,Count=10000) Spent Time(ms)=2375
2006-07-21 11:42:25,703 - TestString(Length=51,Count=100) Spent Time(ms)=0
2006-07-21 11:42:25,828 - TestString(Length=51,Count=1000) Spent Time(ms)=125
2006-07-21 11:42:46,843 - TestString(Length=51,Count=10000) Spent Time(ms)=21000
2006-07-21 11:42:51,359 - TestString(Length=160,Count=100) Spent Time(ms)=16
2006-07-21 11:42:51,828 - TestString(Length=160,Count=1000) Spent Time(ms)=469
2006-07-21 11:43:54,375 - TestString(Length=160,Count=10000) Spent Time(ms)=62546
2006-07-21 11:43:58,875 - TestStringBuilder(Length=9,Count=100) Spent Time(ms)=0
2006-07-21 11:43:58,875 - TestStringBuilder(Length=9,Count=1000) Spent Time(ms)=0
2006-07-21 11:43:58,875 - TestStringBuilder(Length=9,Count=10000) Spent Time(ms)=0
2006-07-21 11:43:58,875 - TestStringBuilder(Length=51,Count=100) Spent Time(ms)=0
2006-07-21 11:43:58,890 - TestStringBuilder(Length=51,Count=1000) Spent Time(ms)=0
2006-07-21 11:43:58,890 - TestStringBuilder(Length=51,Count=10000) Spent Time(ms)=0
2006-07-21 11:43:58,890 - TestStringBuilder(Length=160,Count=100) Spent Time(ms)=0
2006-07-21 11:43:58,890 - TestStringBuilder(Length=160,Count=1000) Spent Time(ms)=0
2006-07-21 11:43:58,921 - TestStringBuilder(Length=160,Count=10000) Spent Time(ms)=15