When a class is marked as a data class, would the generated functions result in the APK size to increase? or would proguard remove it?
e
ephemient
11/05/2022, 4:25 AM
proguard will remove
componentN
and
copy
if they're not used. it won't remove
equals
,
hashCode
,
toString
.
👍 2
z
zt
11/05/2022, 4:31 AM
Would there be a noticeable increase in APK size with many data classes
e
ephemient
11/05/2022, 4:47 AM
if you were going to hand-write those methods anyway then there's no difference. if you are somehow in a situation where you don't need those methods (which is hard to statically prove, so proguard doesn't) then you can either not use data classes or use a plugin like https://twitter.com/lightdelay/status/1490722524014985217 to delete them
ephemient
11/05/2022, 5:09 AM
that plugin doesn't seem to be public. you could message the author, or manually override