Reduce jar size by using abstract classes#4751
Conversation
|
Can you add to the PR how the uncompressed jar size changes after this please? Thanks for doing this. |
400ccdd to
3d4ac2e
Compare
|
I updated the description with sizes |
|
Biggest offenders remaining (can't fix because they are static methods and binary compatibility): |
Yet a substantial decrease in sizes is achieved, thank you! May I suggest the below representation of the size comparisons for nicer visualisation? Details
(generated from your data with help of Github Copilot) |
|
Hi @joroKr21 , thank you again for this incredible work! Meanwhile, would you mind updating your branch to the current state of the repository if you have time please? |
3d4ac2e to
b071721
Compare
b071721 to
18adcdc
Compare
4d54cd9 to
722be35
Compare
satorg
left a comment
There was a problem hiding this comment.
I've looked through as thoroughly as I could and I have to say it is a tremendous and valuable work! Thank you for nailing it!
Traits generate bridge methods in every subclass
Co-authored-by: Sergey Torgashov <satorg@users.noreply.github.com>
722be35 to
3a2a230
Compare
|
@joroKr21 , thank you for keeping it up-to-date! I'm not sure if we should wait for the second approve, to be honest. |
|
This seems like a definite win! Could you note for the record why this is binary compatible? i.e. why it's not a problem that those bridge methods are no longer there? |
The bridge methods are still there, just inherited from the abstract class (and defined only once instead of N times). |
|
Hello team, I'd really appreciate if we could move forward with this PR. Thank you! |
|
Hi @armanbilge @johnynek @LukaJCB, or any other maintainer who is around. I'd personally go with merging this PR, unless you have any objections. Sorry for the ping again, but since this is a rather hefty one, I'd like to double-check that we are all on the same page. |
|
Looks good to me. The win seems valuable enough. We should keep an eye on this in the future if we ever do more codegen (although with scala3 maybe that's a thing of the past). |
|
Thanks everyone! |
|
Hmm, do we publish snapshots? |
|
@joroKr21 yes, the information is output during CI: https://github.com/typelevel/cats/actions/runs/23520949757/attempts/1#summary-68465073798 |
Traits generate bridge methods in every subclass
See #4750