You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Worker 전송 비용 제거 — string은 항상 structured clone(복사), Uint16Array는 transfer(zero-copy). 문서가 클수록 실질적 이득
buildDiffInput 단계 제거 — 이미 완성된 버퍼를 그대로 씀
소유권 일관성 — 텍스트 데이터 수명이 Engine 안에서 완결
diffOptions → tokenize 흐름이 자연스러워지고, 나중에 granularity 같은 옵션도 동일 경로로 흐름
Cons
디버깅 번거로움
tokenize에 공백 삽입 로직 추가 — 단, 분리 가능: tokenize는 raw Uint16Array만 만들고, Engine이 그 위에서 buildTextBuffer(tokens, rawBuffer, diffOptions) 한 번 더 호출하는 구조로 가면 tokenize는 지금처럼 순수하게 유지됨
String.fromCharCode(buffer.subarray(offset, offset+len)) — 어렵진 않음. 그냥 헬퍼 하나
Pros
Cons