-
Notifications
You must be signed in to change notification settings - Fork 613
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
kotlinx-serialization-runtime-js.js from 0.11.0 is not processed correctly with DCE #430
Comments
Your comparison is not very fair since the attached project does not use the library at all, it only includes dependency on it. After adding to 1.3.21:
1.3.30:
The difference is about 50K on runtime + 10K on additional declarations from stdlib (kotlin.js) However, this result can indeed be improved, and we'll continue working on library optimization for DCE. |
Isn't the main purpose of DCE just to remove the unused code? :-) |
There are some top-level declarations that would be used anyway |
Obviously there must be some differences between 0.10.0 and 0.11.0, but of course it is up to you to decide if it's a bug or whether there is some justification. |
Yes, of course, there are some differences – new functionality has been added, and it affected default json instances as well. |
Closing as obsolete |
The
kotlinx-serialization-runtime-js.js
file from 0.11.0 is not reduced enough when DCE tool from Kotlin 1.3.30 is used, even when no serialization is used. The file is reduced from 420KB to 165KB. In 0.10.0 (with Kotlin 1.3.21) the same file is reduced from 374KB to 9KB. This has impact on the size of the output files for Kotlin/JS apps, if the kotlinx.serialization library is present in the sub dependencies, but no serialization features are used.You can see the sample application here: https://github.com/rjaros/js-dce (this is the official js-dce example updated to the current Kotlin version). After running: ./gradlew build the file
build/kotlin-js-min/main/kotlinx-serialization-runtime-js.js
is 165KB. When downgrading to Kotlin 1.3.21 and serialization 0.10.0 the same file is 9KB.The text was updated successfully, but these errors were encountered: