Support loading hyphenation data from uncompiled .dic files as well as compiled .hyf tables
Categories
(Core :: Layout: Text and Fonts, enhancement)
Tracking
()
Tracking | Status | |
---|---|---|
firefox83 | --- | fixed |
People
(Reporter: jfkthame, Assigned: jfkthame)
References
Details
Attachments
(4 files)
See https://github.com/mozilla-mobile/fenix/issues/7223.
The precompiled binary .hyf files used by the mapped_hyph library are substantially larger than the original .dic pattern files from which they are derived (although using them involves a greatly reduced runtime memory footprint). This led to a 1.5MB increase in the Android APK size (as well as increased package sizes for desktop products, but this is much less significant).
To mitigate the APK size increase on Android, we could consider shipping the hyphenation data in the original uncompiled form, and compiling the binary table at runtime when a given dictionary is loaded.
This would give us a reduced APK download size and on-disk footprint, but the trade-off is that there will be a cost to page-load or reflow time on the first occasion hyphenation is requested for any given language (within the browser session).
Once loaded, the compiled table will be cached in shared memory for all content processes to use, so only the initial load of the first page to require hyphenation will be impacted. This may be worth accepting for the sake of reducing the package size.
Assignee | ||
Comment 1•4 years ago
|
||
Updated•4 years ago
|
Assignee | ||
Comment 2•4 years ago
|
||
Depends on D91408
Assignee | ||
Comment 3•4 years ago
|
||
Depends on D91409
Assignee | ||
Comment 4•4 years ago
|
||
This reduces the APK size by about 1.4MB.
Depends on D91410
Pushed by jkew@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/66b86f8b6682 patch 1 - Update to mapped_hyph v0.4.0, to get FFI access to hyphenation table compilation. r=heycam https://hg.mozilla.org/integration/autoland/rev/a1ab26abf3eb patch 1.1 - Run `mach vendor rust` to update in-tree mapped_hyph source. r=heycam https://hg.mozilla.org/integration/autoland/rev/c29703edd736 patch 2 - Update nsHyphenator to support loading either precompiled or uncompiled data. r=heycam https://hg.mozilla.org/integration/autoland/rev/ad5cf7320076 patch 3 - For Android, package the uncompiled versions of hyphenation files. r=heycam
Comment 6•4 years ago
|
||
bugherder |
https://hg.mozilla.org/mozilla-central/rev/66b86f8b6682
https://hg.mozilla.org/mozilla-central/rev/a1ab26abf3eb
https://hg.mozilla.org/mozilla-central/rev/c29703edd736
https://hg.mozilla.org/mozilla-central/rev/ad5cf7320076
Description
•