Repository navigation
chore(assets): jieba 词典 gzip 化 + 删未压缩 models-dev 目录(-7.4MB) - #22
Merged
Merged
Conversation
…talog Two zero-cost APK size wins (~7.4MB) found by benchmarking against taixu / OmniBot (docs/analysis-apk-size-vs-taixu-omnibot.md): - models-dev-api.json (4.1MB): the app reads the .gzip copy first and the plaintext file was only a gunzip-failure fallback — for a local asset that means a corrupt APK, and the network refresh is the real fallback. Asset, code fallback branch, and the update script's plaintext output all removed. The catalog guard test now verifies the gzip itself is readable and still carries the known-majority providers instead of diffing two copies. - jieba dictionaries (5.4MB → 2.1MB): jieba.dict.utf8 and hmm_model are now gzipped in assets and gunzipped onto filesDir at extract time; the native side keeps reading the plain file names, so jieba_jni.cpp is untouched. DICT_VERSION stays at 1 — content is unchanged and already-extracted copies remain valid.
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.
来自 taixu/OmniBot 体积对标(docs/analysis-apk-size-vs-taixu-omnibot.md)的两个零成本瘦身点,功能零损失:
1. 删未压缩 models-dev-api.json(-4.1MB)
代码首选读 gzip 版(416KB),明文版只是 gunzip 失败的回退——本地资产解压失败=APK 损坏,真正的回退是网络刷新路径。删除:
2. jieba 词典 gzip 化(5.4MB → 2.1MB,-3.3MB)
验证
合计 APK 减约 7.4MB。