perf: 그림 변환 메모와 양식 Escape 취소 보정 - #3320
Merged
Merged
Conversation
recordObjectMutation → executeOperation({kind:'snapshot'}) 의 'full' refresh 가
afterEdit() → document-changed 를 이미 emit 하므로, applyRotationDelta/toggleFlip 의
수동 emit(insert.ts:660/673)은 이중 렌더를 유발하는 중복이었다. PR #2346 이 셀 숫자
서식 op 에서 동일 수동 emit 을 제거한 것과 동형 정리.
검증: npx tsc --noEmit(0), npm test(346/346).
관련: #2369(undo 이관 로드맵), 원 지적 PR #2345.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
편집 1회의 리페인트가 레이어 트리를 세 경로(paint/builder.rs, paint/json.rs, renderer/skia/image_conv.rs)에서 각각 빌드하면서 같은 그림 바이트를 매번 다시 변환했다. 가장 비싼 grayscale_jpeg_bytes_to_png_bytes 는 회색인지 알아내려고 JPEG 전체를 디코드하고 전 픽셀을 훑는데, 색 사진이면 None 을 돌려주므로 그 디코드 결과는 통째로 버려진다. 변환 7종은 입력 바이트만으로 결과가 정해지는 순수 함수이므로 결과를 메모한다. 키는 내용 지문(변환 종류 + 길이 + 앞뒤 4KiB)이라 문서 쪽에서 무효화를 알려 줄 필요가 없다. 상한은 16MiB 바이트 기준으로 오래된 것부터 밀어낸다. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
앞뒤 4KiB 표본 키는 JPEG 만 놓고 세운 논거였다. 이 메모는 BMP·TIFF·PCX 에도 걸리는데, 무압축 BMP 는 같은 치수면 길이가 정확히 같고 고정 헤더 뒤에 원시 픽셀이 아래에서 위로 이어진다. 위아래 여백이 균일한 두 그림은 길이·앞 4KiB·뒤 4KiB 가 전부 일치해 한 항목을 공유하고, 가운데만 다른 그림이 남의 변환 결과를 받는다. 64x64 BMP 두 장으로 재현하면 파란 그림 자리에 빨간 그림이 나온다. 키를 바이트 전체 해시로 바꾼다. 3.7MB 기준 1.35ms(릴리스)로, 이 메모가 없앤 285ms 짜리 JPEG 전체 디코드에 비하면 무시할 만하다. 결과가 `None` 인 항목은 바이트를 차지하지 않아 바이트 예산만으로는 밀려나지 않으므로 항목 수 상한도 함께 둔다. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This was referenced Jul 25, 2026
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.
변경
document-changedemit 제거를 수용했습니다.removeCurrentField()방어 경로 설명)을 메인터너 보정과 browser E2E로 반영했습니다.검증
upstream/develrebase 뒤CARGO_TARGET_DIR=target/lpaiu-cs-20260725-review CARGO_INCREMENTAL=0 cargo test --profile release-test --tests --quiet통과cargo build --release, release lib, Native Skia 공식 3종, fmt, Clippy, doctest, WASM build 통과git diff --check통과시각 검증
최신
develefc4b6c4c와 code head40f2f4a3d의 Native Skiasamples/KTX.hwp1·17쪽은 각각 PNG SHA-256 및 pixel 100% 일치했습니다.원 #2370은 여러 P3 항목의 tracker이므로 이 통합으로 close하지 않습니다.
Closes #2520