Generate both small and fast tries as Cargo feature alternatives in baked data #5821
Labels
A-performance
Area: Performance (CPU, Memory)
C-collator
Component: Collation, normalization
C-data-infra
Component: provider, datagen, fallback, adapters
Currently, the baked data we publish on crates.io uses the small type for all tries. For an app that depends on
icu_normalizer
withcompiled_data
, opting into the fast trie type for the NFD and NFKD tries is excessively complicated.databake should generate the data for both trie types so that each data key that maps to a data struct containing a trie gets a Cargo feature for upgrading it to the fast mode.
This way apps could opt into larger but faster data while still using data published on crates.io.
Granular features make sense, because it's quite plausible that an app would want to opt for fast tries for NFD and NFKD while keeping a small trie for UTS 46. It's also plausible to want to do this on a per-property basis.
Alternative approach
ICU4X developers making the call of which tries should always be in the fast mode and which ones should always be in the small mode. Benefits: Not having to branch on trie type at run time and users of the library not needing expertise to make the choice.
The text was updated successfully, but these errors were encountered: