Prettify the version diff reports - #491
Open
Goooler wants to merge 1 commit into
Open
Conversation
JakeWharton
reviewed
Mar 27, 2026
| val newCount = newVersionMap.values.count { it == version } | ||
| BytecodeVersionDiff.Count(oldCount) to BytecodeVersionDiff.Count(newCount) | ||
| } | ||
| .filter { (_, counts) -> counts.first != counts.second } |
Owner
There was a problem hiding this comment.
I'm not too sure about this behavior. I'm tempted to say that if we show the diff at all, we want to show all counts just for the clarity of it.
Contributor
Author
There was a problem hiding this comment.
It's necessary. Covered this case by VersionDiffTest.
JakeWharton
reviewed
Mar 27, 2026
Comment on lines
+256
to
+257
| // Classes shifted versions but net counts per version stayed same. | ||
| // Table is hidden, but class list is shown. |
Owner
There was a problem hiding this comment.
Shouldn't this test fail with the filter removed? I would have expected the chart here now...
Contributor
Author
There was a problem hiding this comment.
versionCounts is emptyMap in this case.
Goooler
force-pushed
the
improve-bytecode-version-diff
branch
from
August 21, 2026 09:38
8a36e33 to
33e0a77
Compare
Goooler
force-pushed
the
improve-bytecode-version-diff
branch
from
August 30, 2026 04:55
33e0a77 to
86def46
Compare
Jar diff:
```
OLD: old.jar
NEW: new.jar
│ compressed │ uncompressed
├──────────┬─────────┬───────┼──────────┬──────────┬───────
JAR │ old │ new │ diff │ old │ new │ diff
───────┼──────────┼─────────┼───────┼──────────┼──────────┼───────
class │ 969 B │ 978 B │ +9 B │ 1012 B │ 1.01 KiB │ +22 B
other │ 634 B │ 659 B │ +25 B │ 82 B │ 81 B │ -1 B
───────┼──────────┼─────────┼───────┼──────────┼──────────┼───────
total │ 1.57 KiB │ 1.6 KiB │ +34 B │ 1.07 KiB │ 1.09 KiB │ +21 B
CLASSES │ old │ new │ diff
─────────┼─────┼─────┼───────────
classes │ 2 │ 2 │ 0 (+1 -1)
methods │ 4 │ 4 │ 0 (+2 -2)
fields │ 0 │ 0 │ 0 (+0 -0)
=================
==== JAR ====
=================
compressed │ uncompressed │
──────────┬────────┼──────────┬────────┤
size │ diff │ size │ diff │ path
──────────┼────────┼──────────┼────────┼───────────────────────────────────────────────
487 B │ +487 B │ 516 B │ +516 B │ + org/example/MainKt.class
│ -484 B │ │ -506 B │ - org/example/Main3Kt.class
210 B │ +210 B │ 56 B │ +56 B │ + META-INF/org.example_untitled.kotlin_module
│ -185 B │ │ -57 B │ - META-INF/untitled.kotlin_module
491 B │ +6 B │ 518 B │ +12 B │ ∆ org/example/Main2Kt.class
──────────┼────────┼──────────┼────────┼───────────────────────────────────────────────
1.16 KiB │ +34 B │ 1.06 KiB │ +21 B │ (total)
=====================
==== CLASSES ====
=====================
CLASSES:
old │ new │ diff
─────┼─────┼───────────
2 │ 2 │ 0 (+1 -1)
+ org.example.MainKt
- org.example.Main3Kt
BYTECODE VERSIONS:
version │ old │ new │ diff
─────────┼─────┼─────┼────────────
65 │ 0 │ 2 │ +2 (+2 -0)
69 │ 2 │ 0 │ -2 (+0 -2)
org.example.Main2Kt: 69 → 65
KOTLIN METADATA VERSIONS:
version │ old │ new │ diff
─────────┼─────┼─────┼────────────
2.3.0 │ 2 │ 0 │ -2 (+0 -2)
2.4.0 │ 0 │ 2 │ +2 (+2 -0)
org.example.Main2Kt: 2.3.0 → 2.4.0
METHODS:
old │ new │ diff
─────┼─────┼───────────
4 │ 4 │ 0 (+2 -2)
+ org.example.MainKt main()
+ org.example.MainKt main(String[])
- org.example.Main3Kt main()
- org.example.Main3Kt main(String[])
```
Apk diff:
```
======================
==== MANIFEST ====
======================
@@ -11,3 +11,3 @@
<uses-sdk
- android:minSdkVersion="23"
+ android:minSdkVersion="26"
android:targetSdkVersion="37"
=================
==== DEX ====
=================
FORMAT VERSIONS:
version │ old │ new │ diff
─────────┼─────┼─────┼────────────
35 │ 3 │ 0 │ -3 (+0 -3)
38 │ 0 │ 2 │ +2 (+2 -0)
classes.dex: 35 → 38
classes2.dex: 35 → 38
```
Goooler
force-pushed
the
improve-bytecode-version-diff
branch
from
August 30, 2026 05:27
86def46 to
4a8fb76
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Apk diff
Closes #490.