What's Changed
- perf: preload subcache headers in FullDyldCache to avoid repeated header reads by @p-x9 in #285
- Improve dyld cache URL construction performance by @p-x9 in #286
- Add benchmark infrastructure for performance work by @p-x9 in #287
- Reuse dyld cache file handles when enumerating Mach-O files by @p-x9 in #288
- Optimize classic rebase and bind segment lookup by @p-x9 in #289
- Cache dyld cache mapping info sequences by @p-x9 in #291
- Optimize closest symbol lookup by @p-x9 in #290
- Avoid eager main cache creation for subcaches by @p-x9 in #292
- Share dyld cache rebase resolution logic by @p-x9 in #293
- Cache dyld mapping info arrays by @p-x9 in #294
- Avoid segment array allocation in address lookups by @p-x9 in #295
Performance
This release includes broad performance improvements for Mach-O and dyld shared
cache analysis. Compared with 0.50.0, representative benchmarks show:
| Area | Benchmark | p50 wall-clock improvement | p50 instruction reduction |
|---|---|---|---|
| Full dyld cache mapping | FullDyldCache.mappingInfo.lookup |
99.7% faster | 99.7% fewer |
| Full dyld cache mapping | FullDyldCache.fileOffset.translate |
99.5% faster | 99.7% fewer |
| Full dyld cache lookup | FullDyldCache.cache.forURL |
95.2% faster | - |
| Full dyld cache lookup | FullDyldCache.cache.forOffset |
93.0% faster | - |
| Full dyld cache rebase | FullDyldCache.resolveRebase |
95.0% faster | 95.3% fewer |
| Full dyld cache rebase | FullDyldCache.resolveOptionalRebase |
94.9% faster | - |
| Full dyld cache image enumeration | FullDyldCache.machOFiles.enumerate |
93.9% faster | 95.1% fewer |
| Dyld cache mapping | DyldCache.mappingInfo.lookup |
93.6% faster | 96.0% fewer |
| Dyld cache mapping | DyldCache.address.translate |
92.9% faster | - |
| Dyld cache mapping | DyldCache.fileOffset.translate |
92.2% faster | - |
| Dyld cache rebase | DyldCache.resolveRebase |
87.4% faster | 88.8% fewer |
| Dyld cache rebase | DyldCache.resolveOptionalRebase |
85.2% faster | - |
| Dyld cache image enumeration | DyldCache.machOFiles.enumerate |
92.0% faster | 93.0% fewer |
| Mach-O symbol lookup | MachOFile.closestSymbol.repeated |
91.6% faster | 89.7% fewer |
| Mach-O address lookup | MachOFile.contains.unslidAddress |
76.2% faster | 79.3% fewer |
| Mach-O address lookup | MachOFile.fileOffset.translate |
28.0% faster | 30.8% fewer |
Full Changelog: 0.50.0...0.51.0
MachOKit
c4139f563b56b9e6fd1bfdb9d0d85ae39b795c296ce24fbedc07536df4c90ff1
MachOKitC
8cdeb024ce530f96b40466957b0eb0839f52e0c139ae67fcfbfb75d091fceeb4