Replies: 4 comments 3 replies
-
Can you provide more details? Which versions of Cats/Scala, which platform? |
Beta Was this translation helpful? Give feedback.
-
We are using Getting file size curl -O https://repo1.maven.org/maven2/org/typelevel/cats-core_3/2.13.0/cats-core_3-2.13.0.jar
du -h cats-core_3-2.13.0.jar
# 6.8M cats-core_3-2.13.0.jar
unzip cats-core_3-2.13.0.jar
du -sh cats
# 30M cats
When extracting our fat jar MacOS finder tells me the following for the cats folder We are using sbt assembly for generating the fat jar. |
Beta Was this translation helpful? Give feedback.
-
I think |
Beta Was this translation helpful? Give feedback.
-
I guess there are lots of other arity-specifc traits in Cats that contribute to the inflated module size too, e.g.: A sad part here is that most of the higher-arity traits and methods are rarely used, but sit in the jar anyway. Perhaps, one of possible solutions could be generating two different cats-core artifacts, e.g. cats-core itself as a "full-sized" one, and cats-core-min as a minimalistic version that only contains arities up to some modest number, e.g. 5 or 6. Another part that could be somehow optimized: there are some non-essential data types like NonEmptyList, NonEmptyVector, etc that might not be exactly required for everyone who depends on cats-core for its typeclasses only. Therefore, such data classes could be extracted into a separate module in order to reduce the size of the core one, I think. |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Hi,
we are using
cats-core
on AWS Lambda.After hitting the 250 MB hard limit, I extracted our fat jar and found out that cats is our biggest dependency by a stretch.
Is there any way to reduce this?
I know there is no tree-shaking as with other languages and some pointed me to using protector.
Beta Was this translation helpful? Give feedback.
All reactions