Notice
Recent Posts
Recent Comments
SNOWFLAKES DRAWING PAPER
[AS] 문자열 더하기 방법 성능비교! 본문
문자열 더하기 방법 성능비교!
http://cafe.naver.com/flex4u/1092
첫번째
for (var i:int = 0; i < 500000; ++i ){
testString += [문자열1]
+ [문자열2]
+ [문자열3];
}
두번째
testArr = [];
for (var j:int = 0; j < 500000; ++j ){
testArr.push([문자열1]);
testArr.push([문자열2]);
testArr.push([문자열3]);
}
testString = testArr.join("");
세번째
for (var k:int = 0; k < 500000; ++k ){
testString += new String().concat(
[문자열1]
,[문자열2]
,[문자열3]);
}
결과 >>
문자열1 = "aaaaaaaaaa"
문자열2 = "bbbbbbbbbb"
문자열3 = "cccccccccc"
첫번째 걸린시간 : 535ms
두번째 걸린시간 : 723ms
세번째 걸린시간 : 1191ms
문자열1 = "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
문자열2 = "bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb"
문자열3 = "cccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc"
첫번째 걸린시간 : 3466ms
두번째 걸린시간 : 582ms
세번째 걸린시간 : 3923ms
'개발 > FLEX/AS3/AIR/BlazeDS' 카테고리의 다른 글
[FLEX] MXML 2009 스펙 (0) | 2008.11.08 |
---|---|
[FLEX] DataGrid RowLine Custom 설정 (2) | 2008.11.06 |
[FLEX] Flex Application 시작시 발생 이벤트 순서 (0) | 2008.10.19 |
[AS3] anglePositionRet :: 원형 위치 값 구하기 (0) | 2008.10.12 |
[AS3] Essential ActionScript 3.0 (PDF) (0) | 2008.10.08 |
Comments