Commit 39eb259
Fix diff stuck on large JARs (#469)
The issue occurred because JAR parsing performs an expensive `sorted()` operation on all class members. During this sort, Diffuse used `TypeDescriptor.compareTo()` which computed a human-readable `sourceName` on-the-fly for every single comparison, causing tens of millions of string allocations and essentially hanging the JVM due to Garbage Collection (GC) thrashing. (APK parsing bypassed this as its DEX reader does not invoke sorting on members).
I changed `TypeDescriptor.compareTo` to directly compare the internal JVM `.value`, which is an instant, allocation-free comparison.
Tested it manually.
Co-authored-by: Jake Wharton <jw@jakewharton.com>1 parent 024e06a commit 39eb259
2 files changed
Lines changed: 6 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2 | 2 | | |
3 | 3 | | |
4 | 4 | | |
| 5 | + | |
5 | 6 | | |
6 | 7 | | |
7 | 8 | | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
8 | 13 | | |
9 | 14 | | |
10 | 15 | | |
| |||
Lines changed: 1 addition & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3 | 3 | | |
4 | 4 | | |
5 | 5 | | |
6 | | - | |
| 6 | + | |
7 | 7 | | |
8 | 8 | | |
9 | 9 | | |
| |||
0 commit comments