you know how webpack and other frontend minifiers ...
# random
n
you know how webpack and other frontend minifiers have tools that let you visualize your bundle? like...hey, jQuery is 60% of your bundle size, maybe you can replace that with zepto... is there something like that for Java/Kotin for uberjars?
a
you can unpack it and use the tool like WizTree
if you're on Linux, Filelight or any other space analyzer will do
n
ah, I've got Disk Usage Analyzer built in. yeah, I suppose that'll work. thanks 🙂
well, except that's uncompressed. still, good enough probably.
good stuff
guess it's mostly dynamodb
n
this gradle task shows me my dependency sizes
Copy code
task<DefaultTask>("depsize") {
        group = "help"
        description = "prints dependency sizes"
        doLast {
            val formatStr = "%,10.2f"
            val files = configurations.default.get().resolve()
            val size = files.map { it.length() / (1024.0 * 1024.0) }.sum()
            val width = (files.map { it.name.length }.max() ?: 45) + 2

            val out = buildString {
                append("Total dependencies size:".padEnd(width))
                append("${String.format(formatStr, size)} Mb\n\n".padStart(12))
                configurations
                    .default
                    .get()
                    .resolve()
                    .sortedWith(compareBy { -it.length() })
                    .forEach {
                        append(it.name.padEnd(width))
                        append("${String.format(formatStr, (it.length() / 1024.0))} kb\n".padStart(12))
                    }
            }
            println(out)
        }
    }
it outputs like so:
Copy code
Total dependencies size:                       14.26 Mb

kotlin-reflect-1.4.20.jar                   2,873.41 kb
kotlinx-coroutines-core-jvm-1.4.2.jar       1,635.68 kb
kotlin-stdlib-1.4.20.jar                    1,453.85 kb
ktor-client-core-jvm-1.4.2.jar              1,017.11 kb
ktor-io-jvm-1.4.2.jar                         998.77 kb
jvm.jar                                       834.48 kb
okhttp-4.6.0.jar                              769.88 kb
kotlinx-html-jvm-0.7.2.jar                    761.71 kb
commons-compress-1.18.jar                     577.88 kb
logback-core-1.2.3.jar                        460.84 kb
ktor-http-jvm-1.4.2.jar                       367.42 kb
ktor-utils-jvm-1.4.2.jar                      359.62 kb
ktor-http-cio-jvm-1.4.2.jar                   303.04 kb
kotlinx-serialization-core-jvm-1.0.1.jar      293.68 kb
logback-classic-1.2.3.jar                     283.53 kb
okio-jvm-2.6.0.jar                            237.63 kb
ktor-network-jvm-1.4.2.jar                    195.01 kb
kotlin-stdlib-common-1.4.20.jar               187.00 kb
jvm.jar                                       155.43 kb
kotlinx-serialization-json-jvm-1.0.1.jar      145.03 kb
kotlin-argparser-2.0.7.jar                     87.54 kb
jvm.jar                                        82.69 kb
jvm.jar                                        78.98 kb
json-schema-serialization-16a71f0ac0.jar       59.96 kb
ktor-client-okhttp-jvm-1.4.2.jar               57.65 kb
jvm.jar                                        53.48 kb
jvm.jar                                        47.22 kb
slf4j-api-1.7.30.jar                           40.50 kb
kotlin-logging-jvm-2.0.3.jar                   30.24 kb
jvm.jar                                        29.73 kb
kotlin-stdlib-jdk7-1.4.20.jar                  21.83 kb
jvm.jar                                        21.29 kb
ktor-client-json-jvm-1.4.2.jar                 18.54 kb
annotations-13.0.jar                           17.13 kb
kotlin-stdlib-jdk8-1.4.20.jar                  15.85 kb
xenocom-0.0.7.jar                              12.59 kb
ktor-client-serialization-jvm-1.4.2.jar        10.88 kb
kotlinx-coroutines-slf4j-1.4.2.jar              3.82 kb
the jvm.jar things are the other modules i am guessing.. that used to not show up when i orginally wrote it
n
that's multiplatform for ya