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

ShadowJar minimization #1063

Closed
Sloox opened this issue Aug 28, 2020 · 2 comments · Fixed by #1071 or #1125
Closed

ShadowJar minimization #1063

Sloox opened this issue Aug 28, 2020 · 2 comments · Fixed by #1071 or #1125
Assignees

Comments

@Sloox
Copy link
Contributor

Sloox commented Aug 28, 2020

Investigate the option of turning the minimisation of the shadowjar gradle task to ON.
Also check the consequences as removing classes form the build could lead to errors due to class not found issues.

Additional context
More information here:https://imperceptiblethoughts.com/shadow/configuration/minimizing/
Apart of the #774 issue chain

@Sloox
Copy link
Contributor Author

Sloox commented Aug 31, 2020

After applying the minimization of the ShadowJar which is an inherint inbuild feature there is a reduction of approximately 30%
Total size shrinks from 38.5 to ~ 26.6 MB
The largest reduction of clases comes from the shrinking of unused google classes.
The greatest shrinkages are listed as follows

  • com.google : 31.8 -> 16.6 MB
    • common: 10.4 -> 6 MB
    • api: 9.3 -> 3.5 MB
    • protobuf: 6.2 -> 4.2 MB
    • cloud: 2.4 -> 1.6 MB
  • com.fasterxml : 7.3 -> 7 MB
  • com.ctc.wstx : 5.5 -> 0.2 MB
  • io.netty : 12.9 -> 8.4 MB
  • io.ktor : 10.9 -> 6.9 MB
  • kotlin : 18.5 -> 17.2 MB
  • org.apache : 7.7 -> 1.3 MB

When it comes to shrinkages the biggest issue is the removal of classes that are actually needed. the shadowjar minimzation function has limited support for excluding packages when compared to Progaurd/R8.
A thorough test will be needed with a fully built jar as the ./gradlew check command will test it on a non minimized jar.

based on the commit : 83d3606 which is master as of 28/08/2020

@Sloox
Copy link
Contributor Author

Sloox commented Sep 2, 2020

Reopenining due to #1077
& the requirement: #1076 & #1072

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
1 participant