Integration 모듈 메서드 지역 StringBuffer 13곳 → StringBuilder (불필요한 동기화 제거)#275
Open
EricSeokgon wants to merge 3 commits into
Open
Integration 모듈 메서드 지역 StringBuffer 13곳 → StringBuilder (불필요한 동기화 제거)#275EricSeokgon wants to merge 3 commits into
EricSeokgon wants to merge 3 commits into
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
문제
Integration 모듈(itl.integration·itl.webservice)의
StringBuffer사용 13곳이 전부 메서드 지역 변수입니다. 다른 스레드로 공개되지 않으므로StringBuffer의 메서드 동기화(synchronized)는 얻는 것 없이 비용만 발생합니다.toString()계열 9곳: SystemDefinition, IntegrationDefinition, OrganizationDefinition, RecordTypeDefinition, RecordTypeFieldDefinition, ServiceDefinition (itl.integration.metadata) / MappingInfo, WebServiceClientDefinition, WebServiceServerDefinition (itl.webservice.data)EgovWebServiceClassLoaderImpl4곳: 메서드 디스크립터·시그니처 조립(desc,signature) — 웹서비스 클래스 동적 생성 경로전수 확인 결과 필드 선언·메서드 파라미터·반환 타입에 StringBuffer가 쓰인 곳은 0건으로, 모두 생성 후 같은 메서드 안에서
toString()으로 끝나는 지역 버퍼입니다.수정
13곳 모두
StringBuilder로 전환했습니다 (10개 파일, +13 −13). 로직·출력 문자열 변화 없음.검증
1) 빌드 — JDK 17.0.19 / Maven 3.9.9, 의존 모듈(egovframe-rte-fdl-logging 5.0.0) 로컬 install 후:
org.egovframe.rte.itl.integration: BUILD SUCCESSorg.egovframe.rte.itl.webservice: BUILD SUCCESS2) 성능 (마이크로벤치, 200만 회 반복 · 워밍업 30만 회, JDK 17.0.19) — 수치를 있는 그대로 싣습니다:
JIT의 락 최적화 덕분에 단일 스레드 환경의 이득은 수십 % 수준으로 크지 않습니다. 이 PR의 주된 근거는 극적인 속도 향상보다 의미 없는 동기화 제거와 관례 정합(지역 버퍼는 StringBuilder)이며, 성능은 부수 효과로 이해해 주시면 좋겠습니다.
영향