Commit a172402
authored
[class-parse] Use BufferedStream to increase performance (#1092)
While building `AndroidX.sln`, `class-parse` is taking up a
considerable amount of time. After some quick profiling, this seems
to be caused by reading from a `ZipStream` one or two bytes at a time.
Wrapping the `ZipStream` in a `BufferedStream` makes `class-parse`
about 10x faster on larger test cases.
| | 0d5cddb | Now |
| --------------------------------------------------------------- | --------: | --------: |
| `class-parse` on API-33 `android.jar` (26.5 MB) | 16.675s | 2.759s |
| `class-parse` on `androidx.compose.runtime.runtime` (1.044 MB) | 9.713s | .893s |
| Total `class-parse` time building `AndroidX.sln` | 5:48.46m | 2:09.73m |
| Total time building `AndroidX.sln` | 7:40.19m | 4:42.34m |1 parent 0355acf commit a172402
1 file changed
+2
-1
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
72 | 72 | | |
73 | 73 | | |
74 | 74 | | |
75 | | - | |
| 75 | + | |
| 76 | + | |
76 | 77 | | |
77 | 78 | | |
78 | 79 | | |
| |||
0 commit comments