Skip to content

[Blazor] "Tree Shaking" not workng as expected #28546

@daniel-p-tech

Description

@daniel-p-tech

Hi,

I'm not sure if this is a bug or simply a typical output of the "tree shaking" algorithm when Blazor app is deployed into production.

I created a very small project that uses DevExpress Blazor components library. The project only contains one page that instantiates two lightweight DevExpress components. The entire library has over two dozens of components including some heavyweights like scheduler and grid.

When I compile the test project in the development environment, the size of the core DLL of the 3rd party library is 2,613,528 bytes. After publishing the project in the release mode, the size of the same file is 2,590,720 bytes - that's a reduction of less than 1%!

Before contacting DevExpress, I'd like to hear your explanation why there is virtually no reduction in size. My understanding was that the linker will strip off any code that is not used by my application. Clearly that should be closer to something like 50-80% depending on how much shared code is needed to instantiate two of their simplest components. Maybe I am doing something incorrectly?

Thank you!

Metadata

Metadata

Assignees

No one assigned

    Labels

    area-blazorIncludes: Blazor, Razor Components

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions