Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[wasm] Introduce <InvariantTimezone> build flag #87284

Merged
merged 10 commits into from
Jul 1, 2023

Conversation

pavelsavara
Copy link
Member

@pavelsavara pavelsavara commented Jun 8, 2023

In Net8 we bundle the timezone database into .wasm file by default. It's not separate download anymore.

To to make download size of browser/wasi application smaller, we could link it out.
The runtime would behave as if there was no timezones in the database and use UTC.
For WASI, it doesn't try to load it from host FS unless you also set TZDIR env variable.

In the project file

<InvariantTimezone>true</InvariantTimezone>

Requires re-linking with wasm workload.

Also backward compatible with BlazorEnableTimeZoneSupport but with workload.

Fixes #37973 for wasm

@pavelsavara pavelsavara added arch-wasm WebAssembly architecture area-Build-mono size-reduction Issues impacting final app size primary for size sensitive workloads labels Jun 8, 2023
@pavelsavara pavelsavara added this to the 8.0.0 milestone Jun 8, 2023
@pavelsavara pavelsavara self-assigned this Jun 8, 2023
@ghost
Copy link

ghost commented Jun 8, 2023

Tagging subscribers to 'arch-wasm': @lewing
See info in area-owners.md if you want to be subscribed.

Issue Details

In Net8 we bundle the timezone database into .wasm file by default. It's not separate download anymore.

To to make download size of wasm/wasi application smaller, we could link it out.
The runtime would behave as if there was no timezones in the database and use UTC.
For WASI, it not try to load it from host FS unless you also set TZDIR env variable.

In the project file

<InvariantTimezone>true</InvariantTimezone>

Requires re-linking with wasm workload.

Also backward compatible with BlazorEnableTimeZoneSupport but with workload.

Fixes #37973 for wasm

Author: pavelsavara
Assignees: pavelsavara
Labels:

arch-wasm, area-Build-mono, size-reduction

Milestone: 8.0.0

@maraf
Copy link
Member

maraf commented Jun 8, 2023

Is it the right time to have two WASM flavors/files in the runtime pack and choose between them during client app build?

@pavelsavara
Copy link
Member Author

I don't have bandwidth to implement it.

@pavelsavara pavelsavara force-pushed the wasm_invariant_timezone branch from 756d84c to cda65db Compare June 26, 2023 15:15
@pavelsavara
Copy link
Member Author

/azp run runtime-wasm

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@pavelsavara
Copy link
Member Author

/azp run runtime-wasm

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

# Conflicts:
#	src/mono/sample/wasm/browser-advanced/Wasm.Advanced.Sample.csproj
@pavelsavara
Copy link
Member Author

image

@pavelsavara pavelsavara marked this pull request as ready for review June 28, 2023 07:04
@pavelsavara
Copy link
Member Author

/azp run runtime-wasm-optional

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

Copy link
Member

@maraf maraf left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me 👍

@kg
Copy link
Member

kg commented Jun 28, 2023

How big is the size savings from this? Just curious


Author: [Pavel Savara](https://github.com/pavelsavara)

It's currently only available for Browser OS
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe specifically call out that it strips the tz data from the binary

@pavelsavara
Copy link
Member Author

How big is the size savings from this? Just curious

over 200KB

# Conflicts:
#	src/mono/wasm/build/WasmApp.targets
@pavelsavara pavelsavara merged commit d388585 into dotnet:main Jul 1, 2023
@ghost ghost locked as resolved and limited conversation to collaborators Jul 31, 2023
@pavelsavara pavelsavara deleted the wasm_invariant_timezone branch September 2, 2024 15:31
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
arch-wasm WebAssembly architecture area-Build-mono size-reduction Issues impacting final app size primary for size sensitive workloads
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add feature-switch for invariant TimeZone support
6 participants