Xcode AI profiler tools#5
Open
DamianMarkowski wants to merge 5 commits into
Open
Conversation
…ile Activity Implement five new static binary analyzers that map to real Xcode Instruments: - EnergyAnalyzer: Detects battery-draining patterns including continuous location tracking, excessive timers, CADisplayLink without frame rate limiting, background processing, sensor usage, and CPU-intensive work. - NetworkAnalyzer: Identifies networking issues including plaintext HTTP URLs, missing certificate pinning, no response caching, multiple networking frameworks, WebSocket without heartbeat, and serialization inefficiencies. - HangsAnalyzer: Finds main-thread-blocking patterns including synchronous I/O, synchronous network requests (critical), heavy computation, complex view hierarchies, missing prefetching/diffable data sources, and Core Data on main thread. - StartupAnalyzer: Analyzes launch time factors including static initializers, linked framework count, ObjC class registration overhead, binary size impact, Swift metadata processing, eager SDK initialization, and Core Data migration at launch. - DiskIOAnalyzer: Profiles file system access including synchronous file ops, large file handling, Core Data batch operations, SQLite WAL mode, file coordination for app groups, temp file cleanup, file protection, and logging I/O patterns. Each analyzer follows the same pattern as existing ones: 8 detection categories, confidence scoring, severity-weighted health score, and detailed metadata. Update InstrumentType enum with 5 new cases including icons, colors, gradients, subtitles, and descriptions. Update AnalysisEngine to orchestrate all 8 analyzers with adjusted progress tracking. Co-authored-by: Damian Markowski <DamianMarkowski@users.noreply.github.com>
Add comprehensive test suites for each new analyzer: - EnergyAnalyzerTests: 11 tests covering location, timers, background processing, network config, sensors, CPU intensity, scoring, metadata - NetworkAnalyzerTests: 13 tests covering HTTP detection, pinning, caching, frameworks, WebSocket, JSON, sessions, transfers, scoring - HangsAnalyzerTests: 12 tests covering sync I/O, heavy computation, view hierarchy, scroll perf, locking, image decoding, Core Data, scoring - StartupAnalyzerTests: 12 tests covering static inits, frameworks, ObjC classes, binary size, conformances, SDK inits, migration, scoring - DiskIOAnalyzerTests: 13 tests covering sync I/O, file handling, Core Data, SQLite, file coordination, temp files, protection, logging, scoring Update existing tests: - ModelTests: Update InstrumentType count from 3 to 8, add raw value checks - AnalysisEngineTests: Update result count from 3 to 8, add result accessor checks for all new instruments Co-authored-by: Damian Markowski <DamianMarkowski@users.noreply.github.com>
Add intentional issue patterns for each new analyzer: - EnergyExamples: Continuous GPS, excessive timers, CADisplayLink, background tasks, motion sensors, CPU-intensive processing - NetworkExamples: Plaintext HTTP URLs, shared session only, no certificate pinning, WebSocket without heartbeat, heavy JSON - HangsExamples: Sync file I/O, sync network, heavy sorting, deep view hierarchies, no prefetch, main thread locks, Core Data on main - StartupExamples: Eager singletons, multiple SDK inits, heavy AppDelegate work, global state initializers - DiskIOExamples: Sync file ops, full file reads, Core Data without batching, SQLite without WAL, temp files, no file protection, app group without coordination, verbose logging Update TestApp ContentView to list new demo categories in navigation. Co-authored-by: Damian Markowski <DamianMarkowski@users.noreply.github.com>
Expand README to document all 8 instruments with detection categories: - LeaksAnalyzer, ConcurrencyAnalyzer, AllocationsAnalyzer (existing) - EnergyAnalyzer, NetworkAnalyzer, HangsAnalyzer (new) - StartupAnalyzer, DiskIOAnalyzer (new) Update repository layout, architecture section, TestApp purpose, and typical workflow to reflect the expanded analysis capabilities. Co-authored-by: Damian Markowski <DamianMarkowski@users.noreply.github.com>
|
Cursor Agent can help with this pull request. Just |
StartupAnalyzer: Remove parentheses from SDK init search patterns
("configure(", "initialize(", etc.) since Mach-O symbol names don't
contain parentheses. This allows the patterns to match symbols like
_Firebase_configure correctly.
DiskIOAnalyzer: Add "CoreData" to Core Data detection patterns so that
symbols like _CoreData_ref count as evidence, ensuring the threshold
is met for the batch size check.
Co-authored-by: Damian Markowski <DamianMarkowski@users.noreply.github.com>
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.
Add 5 new profiler tools (Energy, Network, Hangs, Startup, Disk I/O) to expand Xcode Instruments-based analysis capabilities.