Commit fc134a5
authored
Fix #25707 - slow iOS kernelcache loading by bulk-reading into memory ##bin
r_cf_value_dict_parse was reading the XML prelink info one byte at a
time through the full I/O stack (seek+read syscalls per byte for a 3MB
buffer). Bulk-read the entire region into memory first.
find_class_registrations was reading 8 bytes per instruction through
the I/O stack while decoding .init. functions. Use load_kext_text_blob
to read the entire kext text section once, matching the pattern already
used by find_class_vtables.
Reduces load time for non-MH_FILESET kernelcaches from ~3min to ~6sec.1 parent 6cb1ed3 commit fc134a5
2 files changed
Lines changed: 29 additions & 11 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
76 | 76 | | |
77 | 77 | | |
78 | 78 | | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
79 | 89 | | |
80 | 90 | | |
81 | 91 | | |
| |||
92 | 102 | | |
93 | 103 | | |
94 | 104 | | |
95 | | - | |
96 | | - | |
97 | | - | |
| 105 | + | |
| 106 | + | |
98 | 107 | | |
99 | 108 | | |
100 | 109 | | |
| |||
379 | 388 | | |
380 | 389 | | |
381 | 390 | | |
| 391 | + | |
382 | 392 | | |
383 | 393 | | |
384 | 394 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
207 | 207 | | |
208 | 208 | | |
209 | 209 | | |
| 210 | + | |
210 | 211 | | |
211 | 212 | | |
212 | 213 | | |
| |||
2003 | 2004 | | |
2004 | 2005 | | |
2005 | 2006 | | |
| 2007 | + | |
| 2008 | + | |
| 2009 | + | |
| 2010 | + | |
| 2011 | + | |
2006 | 2012 | | |
2007 | 2013 | | |
2008 | 2014 | | |
| |||
2019 | 2025 | | |
2020 | 2026 | | |
2021 | 2027 | | |
2022 | | - | |
2023 | | - | |
| 2028 | + | |
| 2029 | + | |
2024 | 2030 | | |
2025 | 2031 | | |
2026 | 2032 | | |
| |||
2081 | 2087 | | |
2082 | 2088 | | |
2083 | 2089 | | |
2084 | | - | |
2085 | | - | |
2086 | | - | |
2087 | | - | |
2088 | | - | |
2089 | | - | |
2090 | 2090 | | |
2091 | 2091 | | |
2092 | 2092 | | |
| |||
2101 | 2101 | | |
2102 | 2102 | | |
2103 | 2103 | | |
| 2104 | + | |
2104 | 2105 | | |
2105 | 2106 | | |
2106 | 2107 | | |
| |||
2446 | 2447 | | |
2447 | 2448 | | |
2448 | 2449 | | |
| 2450 | + | |
| 2451 | + | |
| 2452 | + | |
| 2453 | + | |
| 2454 | + | |
| 2455 | + | |
| 2456 | + | |
2449 | 2457 | | |
2450 | 2458 | | |
2451 | 2459 | | |
| |||
0 commit comments