Is kotlin-reflect really needed for lets-plot?
See original GitHub issueI’m about to add lets-plot charts to Apache JMeter, and it turns out kotlin-reflect-1.5.21.jar consumes 3 megabytes (~18% of the new jars).
Could kotlin-reflect dependency be avoided in lets-plot?
Just for reference, here’s the list of all the jars Kotlin + lets-plot brings:
54852334 => 71166807 bytes (+16314473 bytes)
99 => 134 files (+35)
+ 17536 annotations-13.0.jar
- 18538 annotations-16.0.2.jar
+ 507197 base-portable-jvm-2.1.0.jar
+ 485809 batik-anim-1.14.jar
+ 424624 batik-awt-util-1.14.jar
+ 703757 batik-bridge-1.14.jar
+ 112373 batik-codec-1.14.jar
+ 8433 batik-constants-1.14.jar
+ 330318 batik-css-1.14.jar
+ 184487 batik-dom-1.14.jar
+ 10238 batik-ext-1.14.jar
+ 192087 batik-gvt-1.14.jar
+ 11466 batik-i18n-1.14.jar
+ 76875 batik-parser-1.14.jar
+ 25876 batik-script-1.14.jar
+ 6663 batik-shared-resources-1.14.jar
+ 232734 batik-svg-dom-1.14.jar
+ 227514 batik-svggen-1.14.jar
+ 129300 batik-transcoder-1.14.jar
+ 127477 batik-util-1.14.jar
+ 33866 batik-xml-1.14.jar
+ 32033 kotlin-logging-jvm-2.0.5.jar
+ 2993765 kotlin-reflect-1.5.21.jar
+ 1505952 kotlin-stdlib-1.5.31.jar
+ 198322 kotlin-stdlib-common-1.5.31.jar
+ 22986 kotlin-stdlib-jdk7-1.5.31.jar
+ 16121 kotlin-stdlib-jdk8-1.5.31.jar
+ 792176 kotlinx-html-jvm-0.7.3.jar
+ 196707 lets-plot-batik-2.1.0.jar
+ 3593892 lets-plot-common-2.1.0.jar
+ 627895 plot-api-jvm-3.0.2.jar
+ 882509 plot-base-portable-jvm-2.1.0.jar
+ 792534 plot-builder-portable-jvm-2.1.0.jar
+ 115007 plot-common-portable-jvm-2.1.0.jar
+ 454864 plot-config-portable-jvm-2.1.0.jar
+ 173932 vis-svg-portable-jvm-2.1.0.jar
+ 85686 xml-apis-ext-1.3.04.jar
Issue Analytics
- State:
- Created 2 years ago
- Comments:6
Top Results From Across the Web
android - when is kotlin reflect lib necessary? - Stack Overflow
I can do basic reflection (listing members,parameters,etc) without explicitly referencing this library. When do i have to include it on android ...
Read more >Lets-Plot, in Kotlin - The JetBrains Blog
Today I'd like to talk to you about Lets-Plot for Kotlin, an open-source plotting library for statistical data written entirely in Kotlin.
Read more >I m using LetsPlot to graph a line electrocardiogram plus a | Kotlinlang
I'm using LetsPlot to graph a line (electrocardiogram) plus a scatterplot of detected R peaks. This helps visualize whether the R peak detection...
Read more >lets-plot-kotlin-jvm : 3.0.1 - Maven Central Repository Search
Lets-Plot Kotlin API - Lets-Plot Kotlin API.
Read more >kotlin-jupyter-kernel - Python Package Health Analysis | Snyk
Learn more about kotlin-jupyter-kernel: package health score, popularity, ... --jvm-arg=arg in particular is needed when passing JVM arguments that start ...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Yes, most reflection we are using is provided by stdlib (
Klass.name
,KProperty.name
). Exceptions are AesReflectTest and LiveMapTestBase. In fact we already refactored LiveMap tests so there is no need in that kind of reflection, so I removed the code that depends onkotlin-reflect
.So what I did - I removed all
kotlin-reflection
deps except one - forjvmTest
inplot-base-portable
. I did excessive testing by running our JVM, Native and JS applications - everything looks fine. If you will notice any problems after this change, please, make us know.Sounds good! If
::class.name
indeed doesn’t fail at runtime withoutkotlin-reflect
then I don’t see a reason to bundle this dependency. For now it should be safe to just exclude it as you did.