ringsaturn/tzf-rs

Add option to select which time zones are included in the compiled binary

avsaase opened this issue · 3 comments

Hi, I'm using your library in a serverless wasm context and I need to be mindful of binary size. Would it be possible to to provide an option that lets the user filter which time zones are included at build time? The chrono-tz crate provides such an option by enabling a feature and setting an environment variable (details)

Would something similar be possible in tzf-rs?

Hi,

From your desc, I'm sorry to tell you that's impossible.

The timezone shape data behind tzf-rs is tzf-rel. Even you only use 1 timezone, all the polygon data will still be packaged with binary. For your use cases, I need to split one file to ~200 files and leaving an option to choose.

But I recommend you take a look about tz-search, less size and less memory usage.

I was afraid that would be the case.

Unfortunately tz-search doesn't compile in my project. It also looks unmaintained. I'll look for a different solution. Thanks for the quick reply!

Timezone polygon data could be very large, not suit for your case. As I can image:

Hope you can find a good solution!