About compiler optimization

For example, suppose that 2 classes that do not have relationships to each other are defined in the static link library.
Suppose the Console application references the library and uses only one class.

When you check the release compiled exe binary, it seems that all the classes included in the library are built in.
It does not seem to be built in if you do not use classes at all included in the library.
Also, in the case of classes included in the same project(is console application), even if you do not use them, they are built in.
ConsoleApplication1.zip (96.3 KB)

I plan to make a big library containing many classes in one .fx in the future.
When someone uses this library, I want to avoid exe’s binary size becoming too big.
Is it possible to strengthen compiler optimization?

Should surely be possible. I’ll log an issue to look into this.

Thanks, logged as bugs://76964

Thank you.

I do not know if the survey conducted by me is reasonable or not.
I think that you can understand by seeing the uploaded project, but each class outputs a unique character string.
I have investigated whether these Unicode strings are included in the binary.

Ah…Perhaps, Island has plans to implement features similar to .NET reflection in the future?

When creating an instance from a type name like .NET, it is certainly impossible to exclude classes that are not used directly…

We do want that, but only for used types and types as marked to stay alive. It should still eliminate everything you don’t use, I’ll take a look.

1 Like

bugs://76964 got closed with status fixed.

Logged as bugs://i64743.

bugs://i64743 was closed as fixed.