MTHawkeye: iOS Debugging and Performance Optimization Toolkit
MTHawkeye is Meitu’s iOS debugging and performance‑optimization toolkit that provides a three‑layer architecture—foundation, UI foundation, and plugin layers—to assist developers across development, testing, and production by offering memory leak detection, main‑thread profiling, CPU, network, graphics, storage monitoring, and integrated FLEX utilities.
MTHawkeye is a debugging assistance and performance optimization toolkit used by Meitu's iOS team, designed to help iOS developers improve development efficiency and optimize performance experience.
Throughout the product development lifecycle, MTHawkeye is introduced to help discover, find, analyze, locate, and resolve issues more quickly:
Development phase: Focuses on development debugging assistance, detecting issues in a timely manner and prompting developers when necessary
Testing phase: Focuses on collecting as much data as possible based on test scenarios for automated test analysis reports
Production phase: Focuses on supplementing performance data that traditional APM components lack but the business itself needs to collect
MTHawkeye consists of three layers: the bottom Foundation Layer provides plugin management, storage capabilities, and basic utility classes. The middle UI Foundation Layer provides the UI skeleton for development and testing phases, including floating windows, main interface framework, and settings panels. The top layer contains various plugins with different responsibilities based on scenarios.
Memory Plugins:
LivingObjectSniffer : Tracks objects held directly or indirectly by ViewControllers and custom View objects, detecting abnormal retention such as memory leaks, untimely release, or unnecessary caching
Allocations : Similar to Instrument's Allocations feature, tracks actual memory allocation details to troubleshoot memory usage issues during abnormal usage or OOM exits
TimeConsuming Plugins:
UITimeProfiler : Assists in optimizing time-consuming tasks on the main thread, divided into VC Life Trace for tracking ViewController opening stages and ObjC CallTrace for tracking Objective-C methods exceeding specified time thresholds
ANRTrace : Captures ANR events and samples main thread call stacks when freezes occur
FPSTrace : Tracks UI FPS and OpenGL refresh/draw FPS, displaying current values in floating windows
Energy Plugins:
CPUTrace : Tracks sustained high CPU usage and records which methods are primarily called during high usage periods
Network Plugins:
NetworkMonitor : Monitors and records HTTP(S) network request timing in the app, providing built-in record viewing interface. Features include: inheriting from FLEX network request records with filtering/search, recording URLSessionTaskMetrics for iOS 9+ requests, waterfall view similar to Chrome network debugging, duplicate request detection, multi-condition search support, and complete network request record display
NetworkInspect : Based on Network Monitor, detects improvable items from actual recorded network requests
Graphics Plugins:
OpenGLTrace : Tracks OpenGL resource memory usage, assists in discovering OpenGL API errors and abnormal parameter passing. Uses FishHook to hook OpenGL ES and CoreVideo functions on iOS platform for monitoring Texture/Program resources
Storage Plugins:
DirectoryWatcher : Tracks sandbox folder sizes for detecting abnormal file management issues during development/testing, integrates FLEX sandbox file viewing with AirDrop support
Utility Plugins:
FLEX : Common debugging assistance tool in daily development, with MTHawkeye plugin extending AirDrop support for sandbox files
Meitu Technology
Curating Meitu's technical expertise, valuable case studies, and innovation insights. We deliver quality technical content to foster knowledge sharing between Meitu's tech team and outstanding developers worldwide.
How this landed with the community
Was this worth your time?
0 Comments
Thoughtful readers leave field notes, pushback, and hard-won operational detail here.