3 ms·
As a former servlet API guy switched over to android I'm getting good results using proguard for pruning unused dependency parts from an ancient desktop app I'm
by usrusr 6y ago
As a former servlet API guy switched over to android I'm getting good results using proguard for pruning unused dependency parts from an ancient desktop app I'm maintaining on the side. Surely a hit on build times and on sanity as well whenever you use a library that relies on reflection internally, but it completely changed the way I deal with the convenience/download size tradeoff when deciding on dependencies.
- geokon 6y agoYeah, it's not a bad idea. I did try proguard at one point.. but it's such a baroque tool. It's likely something I did wrong, but I never managed to get proguard to remove anything properly. Either nothing was removed or it'd remove too much and kill the program. It's been a while, but something about it gave me the impression it didn't play with Clojure I wonder if you can then jlink the result
- usrusr 6y agoBaroque it is. Clojure might be a death sentence for the proguard approach, considering how deeply the terms clojure and invokedynamic seem to be connected. But if you happen to depend on some deep library stacks only for some minor scraps of it's functionality it might still be worth it, define a blanket exception for your own code and, if not picked up automatically, for the few entry points where you call from clojure into the java world. If you don't mind keeping twice as much as strictly necessary, kicking out some low hanging fruits shouldn't be that hard. (but in combination with build times and future friction a division against proguard might still be very, very rational)
- geokon 6y agoRight, yeah. That was exactly the issue. Tons of garbage gets dragged in when you use a little corner of a huge library. And I'm mostly leaning on Java libraries. Yet it seems it somehow couldn't figure out which parts I was using and which I wasn't. I'll try to give it another shot eventually. Thanks for the tips :)