镜像站点 · 本页由第三方 GitHub 只读镜像提供,非 GitHub 官方站点,不接受任何登录或凭据输入。前往 github.com
Skip to content

[wasm] Size regression #74506

Closed
Closed

Description

@radekdoulik

We are now tracing browser-bench sample AppBundle size in daily measurements https://github.com/radekdoulik/WasmPerformanceMeasurements/blob/main/measurements/index.zip and there was quite large size regression around 8/12/2022. The AppBundle size increased by cca 1.1MB.

By bisecting the commits I got to the commit, which causes that, c55d76d from PR #72051.

I am not yet sure, what in that commit caused the regression.

Activity

  1. added this to the 8.0.0 milestone on Aug 24, 2022
  2. AaronRobinsonMSFT commented on Aug 24, 2022

    @AaronRobinsonMSFT
    Member

    @radekdoulik It is entirely possible something was missed to prune out the transaction code for WASM. Is there something that was missed?

    /cc @roji

  3. radekdoulik commented on Aug 30, 2022

    @radekdoulik
    MemberAuthor

    Not sure yet. It looks like something pulls in System.Transactions.Local and few other assemblies.

    ls .\before\managed\
    
        Directory: C:\Users\rodo\git\size-regression\before\managed
    
    Mode                 LastWriteTime         Length Name
    ----                 -------------         ------ ----
    -a---           8/30/2022  4:02 PM          16896 System.Collections.Concurrent.dll
    -a---           8/30/2022  4:02 PM           8704 System.Collections.dll
    -a---           8/30/2022  4:02 PM          14848 System.Console.dll
    -a---           8/30/2022  4:02 PM          12288 System.Linq.dll
    -a---           8/30/2022  4:02 PM          14336 System.Memory.dll
    -a---           8/30/2022  4:02 PM           6144 System.Net.Http.dll
    -a---           8/30/2022  4:02 PM          22528 System.Net.WebSockets.Client.dll
    -a---           8/30/2022  4:02 PM           9216 System.Net.WebSockets.dll
    -a---           8/30/2022  4:02 PM        1088512 System.Private.CoreLib.dll
    -a---           8/30/2022  4:02 PM          57856 System.Private.Uri.dll
    -a---           8/30/2022  4:02 PM           7168 System.Runtime.dll
    -a---           8/30/2022  4:02 PM          33792 System.Runtime.InteropServices.JavaScript.dll
    -a---           8/30/2022  4:02 PM           5120 System.Runtime.Intrinsics.dll
    -a---           8/30/2022  4:02 PM          30208 System.Text.Encodings.Web.dll
    -a---           8/30/2022  4:02 PM         307712 System.Text.Json.dll
    -a---           8/30/2022  4:02 PM         125952 System.Text.RegularExpressions.dll
    -a---           8/30/2022  4:02 PM          83968 Wasm.Browser.Bench.Sample.dll
    
    PS C:\Users\rodo\git\size-regression> ls .\after\managed\
    
        Directory: C:\Users\rodo\git\size-regression\after\managed
    
    Mode                 LastWriteTime         Length Name
    ----                 -------------         ------ ----
    -a---           8/30/2022  4:07 PM          16896 System.Collections.Concurrent.dll
    -a---           8/30/2022  4:07 PM           8704 System.Collections.dll
    -a---           8/30/2022  4:07 PM          15360 System.Console.dll
    -a---           8/30/2022  4:07 PM           5120 System.Diagnostics.Tracing.dll
    -a---           8/30/2022  4:07 PM          12288 System.Linq.dll
    -a---           8/30/2022  4:07 PM          14336 System.Memory.dll
    -a---           8/30/2022  4:07 PM           6144 System.Net.Http.dll
    -a---           8/30/2022  4:07 PM          22528 System.Net.WebSockets.Client.dll
    -a---           8/30/2022  4:07 PM           9728 System.Net.WebSockets.dll
    -a---           8/30/2022  4:07 PM        1183744 System.Private.CoreLib.dll
    -a---           8/30/2022  4:07 PM          58368 System.Private.Uri.dll
    -a---           8/30/2022  4:07 PM           8704 System.Runtime.dll
    -a---           8/30/2022  4:07 PM           5632 System.Runtime.InteropServices.dll
    -a---           8/30/2022  4:07 PM          33792 System.Runtime.InteropServices.JavaScript.dll
    -a---           8/30/2022  4:07 PM           5120 System.Runtime.Intrinsics.dll
    -a---           8/30/2022  4:07 PM          30208 System.Text.Encodings.Web.dll
    -a---           8/30/2022  4:07 PM         308224 System.Text.Json.dll
    -a---           8/30/2022  4:07 PM         126464 System.Text.RegularExpressions.dll
    -a---           8/30/2022  4:07 PM           5632 System.Threading.dll
    -a---           8/30/2022  4:07 PM           5120 System.Threading.Thread.dll
    -a---           8/30/2022  4:07 PM           5120 System.Threading.ThreadPool.dll
    -a---           8/30/2022  4:07 PM         163840 System.Transactions.Local.dll
    -a---           8/30/2022  4:07 PM          83968 Wasm.Browser.Bench.Sample.dll
    
  4. radekdoulik commented on Aug 30, 2022

    @radekdoulik
    MemberAuthor

    I think c55d76d#diff-197d1d73f09b5e9ce1e832442f7dccd63df0be0b7b8a47f6c682099ba84e5452R8 is the issue here.

    If I understand it correctly, System.Transactions.Local is part of NetCoreAppLibrary property in src/libraries/NetCoreAppLibrary.props and it has IsTrimmable set to false now. Thus it survives trimming and brings itself and dependencies into every netcore app.

    @roji why do we need IsTrimmable be set to false for System.Transactions.Local?

  5. roji commented on Aug 30, 2022

    @roji
    Member

    @radekdoulik with the porting of Windows-only distributed transaction support into System.Transactions.Local (#72051), this library now does COM interop, which is currently incompatible with trimming; so it was recommended to set IsTrimmable to false (see conversation here). It seems there's a desire to have a source generator for COM (in .NET 8.0), at which point we can mark the assembly as trimmable again...

    /cc @ajcvickers

  6. jkotas commented on Aug 30, 2022

    @jkotas
    Member

    why do we need IsTrimmable be set to false for System.Transactions.Local?

    You can do that for Windows only. It would fix the wasm regression.

  7. ghost added
    in-prThere is an active PR which will close this issue when it is merged
    on Aug 30, 2022
  8. radekdoulik commented on Aug 30, 2022

    @radekdoulik
    MemberAuthor

    Thanks for clarifying it. That should apply only for windows then, right? If so, we can make the property conditional to improve linking on other target platforms, like WebAssembly and mobile platforms. I opened #74828 for that.

  9. roji commented on Aug 30, 2022

    @roji
    Member

    Yep, makes sense.

  10. ghost removed
    in-prThere is an active PR which will close this issue when it is merged
    on Aug 31, 2022
  11. ghost locked as resolved and limited conversation to collaborators on Sep 30, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions