4 ms·
Why do they obfuscate if they're just going to provide the mappings?
by zachrip 11mo ago
Why do they obfuscate if they're just going to provide the mappings?
- kulahan 11mo agoWell, maybe that's why they're not obfuscating anymore.
- singron 11mo agoProguard can also apply optimizations while it obfuscates. I think a good JVM will eventually do most of them itself, but it can help code size and warm-up. I'm guessing as JVMs get better and everyone is less sensitive to file sizes, this matters less and less.
- mort96 11mo agoAnd there's no way to do only the optimisation part? Surely you could optimise without messing up class and method names..?
- the_hoser 11mo agoOne of the biggest optimizations it offers is shrinking the size of the classes by obfuscating the names. If you're obfuscating the names anyway, there's no reason that the names have to be the same length. "hn$z" is a heck of a lot smaller than "tld.organization.product.domain.concern.ClassName"
- voxic11 11mo agoYeah in some ways the obfuscation and mappings are similar to minification and sourcemaps in javascript.
- mort96 11mo agoAnd minification in JavaScript only reduces the amount of bytes that has to be sent over the wire, it doesn't improve runtime performance.
- voxic11 11mo agoAccording to the v8 devs it also can increase parsing performance > Our scanner can only do so much however. As a developer you can further improve parsing performance by increasing the information density of your programs. The easiest way to do so is by minifying your source code, stripping out unnecessary whitespace, and to avoid non-ASCII identifiers where possible. https://v8.dev/blog/scanner https://v8.dev/blog/scanner
- mort96 11mo agoSure, but that's also just in the category improving loading a bit. It doesn't have anything to do with runtime performance.
- mort96 11mo agoSo we're not talking about runtime performance, but some minor improvement in loading times? I assume that once the JVM has read the bytecode, it has its own efficient in-memory structures to track references to classes rather than using a hash map with fully qualified names as keys
- saagarjha 11mo agoThe names need to be stored somewhere because they are exposed to the program that way
- swiftcoder 11mo agoProguard was heavily influenced by the needs of early Android devices, where memory was at a real premium. Reducing the size of static tables of strings is a worthwhile optimisation in that environment
- mort96 11mo agoOkay but we're talking about Minecraft on desktops and laptops, where the relevant optimizations would be runtime performance optimizations, no?
- swiftcoder 11mo agoProbably, but proguard tends to bundle the whole lot together