TE
科技回声
首页24小时热榜最新最佳问答展示工作
GitHubTwitter
首页

科技回声

基于 Next.js 构建的科技新闻平台,提供全球科技新闻和讨论内容。

GitHubTwitter

首页

首页最新最佳问答展示工作

资源链接

HackerNews API原版 HackerNewsNext.js

© 2025 科技回声. 版权所有。

Shrinking a Kotlin Binary by 99.2%

100 点作者 farmerbb将近 5 年前

5 条评论

brabel将近 5 年前
If you're going to get rid of all your Kotlin std lib usages by explicitly replacing them, after inspecting the actual class files generated by the compiler, with standard Java methods (and hope that no future change will re-introduce them) and you care so much about the size of your jars, I would say you're better off simply going back to Java, perhaps using the very latest version (since you're willing to use Kotlin that shouldn't be a problem) which has lots of niceties and to me, at least, looks a lot better than using Kotlin with these kinds of hacks. Add a nullability static analysis check and you're gold.
评论 #24280061 未加载
评论 #24280136 未加载
评论 #24283307 未加载
评论 #24280494 未加载
评论 #24279981 未加载
评论 #24280687 未加载
评论 #24283315 未加载
wnoise将近 5 年前
&gt; - val old = args[0].let(::File).readText() &gt; - val new = args[1].let(::File).readText() &gt; + val old = args[0].let(Paths::get).let(Paths::readString) &gt; + val new = args[0].let(Paths::get).let(Paths::readString)<p>Missed index. 0!=1.
评论 #24280837 未加载
评论 #24283241 未加载
toolslive将近 5 年前
It used to help a lot (30-40%) to sort the class files of a librarly on canonical name before you add them to its jar. Class files contain that name, and are (typically) small. Your compression factor will grow. (maybe that trick is standard now)
评论 #24283355 未加载
mro_name将近 5 年前
any idea how to get the swift upload network traffic down?<p>My 500K objc ipa ported to swift <a href="http:&#x2F;&#x2F;mro.name&#x2F;ShaarliOS" rel="nofollow">http:&#x2F;&#x2F;mro.name&#x2F;ShaarliOS</a> now is ~8MB (OTA test ipa), ~28MB for production upload causing ~300MB traffic until finally uploaded via xcrun, taking 1h on my rural uplink.<p>Has anybody an idea how to get back to sane dimensions?
setheron将近 5 年前
Looks like most of the size reduction was from running R8. The rest seems meaningless.