Monitoring startup time

  1. The pre-main stage was monitored by DYLDDYLD_PRINT_STATISTICS

Dylid Loading Time: loading time of the dynamic library

Rebase: fix offset, binding: external function symbol binding

Objc Setup Time: time for OC class registration

, initializer time:

The solution

The project reduced the number of dynamic libraries by more than six merged dynamic libraries and discarded useless classes in the project

  • Cold start

The process of loading data from disk into physical memory

  • Warm start

Data exists in physical memory, and the process of reading physical memory is started

Optimization scheme

  • Off-screen rendering
  • Multithreaded asynchronous loading
  • Optimize the executable

Item loading sequence

The executable file of the project is lazily loaded into physical memory on a page basis

  • Lazy loading: When the system accesses virtual memory and data is not loaded into physical memory, the system throws PageFult and data is loaded into physical memory as pages