Repository navigation
日本語変換の辞書探索を高速化 / Speed up Japanese dictionary prediction - #1270
Merged
Merged
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.
日本語
変更内容
実機のスタックサンプリングでは、システム辞書の補完処理が変換セッション中の 2,313 / 6,763 サンプルに現れた。変更後は 186 / 4,083 サンプルだった。
Pixel 6 実測
Android 17(API 37)、
liteStandardDebug、同じ計測 APK と同一の同梱アセット。AOT のコンパイルモードをそろえ、同梱 N-gram 辞書を有効にして、10 文の入力途中の 124 状態を各条件で 40 周計測した。時間は IME が呼び出す変換セッションの応答時間。割り当ては ART のプロセス内割り当ての平均。既定の p95 は 62.5% 短縮し、3〜6 文字の p95 は 28.81 → 5.57 ms。APK を入れ替えて既定設定を再測定した場合、全入力の p95 は 13.67 → 5.17 ms、3〜6 文字は 28.97 → 5.55 ms。計測後に GC を実行した時点のプロセス PSS は 77.14 → 77.13 MiB、再測定では 76.97 → 78.67 MiB。
検証
dev(be49efe4a)でも再現した。PackedStandaloneUnigramDictionaryTest.standaloneMatchesOnlyWholeInputLiteralReadingNodesKanaKanjiConversionSessionParityTest.asciiInputKeepsHalfWidthUppercaseAcrossQueryModesEnglish
Changes
In a separate device stack-sampling run, system dictionary completion appeared in 2,313 of 6,763 conversion-session samples on the baseline and 186 of 4,083 after the change.
Pixel 6 measurements
Android 17 (API 37),
liteStandardDebug, with the same instrumentation APK and identical bundled assets. Both builds used the same AOT compiler mode and bundled N-gram dictionary. Each configuration ran 40 repetitions of the 124 prefixes from 10 phrases. Timing covers the conversion session called by the IME. Allocation is the mean ART process allocation per request.Default p95 fell by 62.5%. For 3–6 character prefixes, p95 was 28.81 → 5.57 ms. After swapping APKs and repeating the default measurement, overall p95 was 13.67 → 5.17 ms and 3–6 character p95 was 28.97 → 5.55 ms. Post-GC process PSS was 77.14 → 77.13 MiB and 76.97 → 78.67 MiB in the repeat.
Verification
devrevision (be49efe4a).PackedStandaloneUnigramDictionaryTest.standaloneMatchesOnlyWholeInputLiteralReadingNodesKanaKanjiConversionSessionParityTest.asciiInputKeepsHalfWidthUppercaseAcrossQueryModes