Open Esteth opened 3 hours ago
We have an android module, so we could make it conditional on that. I'll take a look.
But we would need to prove it's noticeably faster to be worth the effort.
I'm virtually certain there are memory wins to be had because AFAIK using Java Resources on android require holding the EOCD zip table for the whole APK in memory in perpetuity once they've been accesed. Loading that table from disk and unpacking it can also take some time.
For small apps this is a small cost, but for large apps that table can be large (1MB+) because it contains strings for all the files in the APK among other things.
On some platforms, Java Resources are expensive to load and encode compared to a platform's native solution for bundling data. The public suffix file is loaded using Java Resources.
This is the case on Android, where Android Resources are faster to load and smaller to store than Java Resources as used in PublicSuffixDatabase.kt
Ideally, each Platform could choose to override the loading behavior for the public suffix database, falling back to the default behavior with java resources since it's supported on all java platforms.