Coder Social home page Coder Social logo

byczd / ttanalyzeloadtime Goto Github PK

View Code? Open in Web Editor NEW

This project forked from yixiangboy/ttanalyzeloadtime

0.0 2.0 0.0 137 KB

通过Mach-O文件NonlazyClassList构建动态库进行iOS load方法耗时检测

License: MIT License

Ruby 10.32% Objective-C 29.78% Objective-C++ 59.90%

ttanalyzeloadtime's Introduction

TTAnalyzeLoadTime

通过Mach-O文件NonlazyClassList构建动态库进行iOS load方法耗时检测

How To Get Started

简介

  • 仓库中提供了源码以及二进制的文件,源码提供了整个AnalyzeLoadTime的全部文件TTLoadTime.mm,二进制文件为一个动态库(为什么提供动态库文末有介绍),动态库为尽可能提前执行Load Method Swizzling提供了可能
  • 重写_getObjc2NonlazyCategoryList _getObjc2NonlazyClassList (runtime源码中有介绍),可以快速拿到全部load的所属Class以及load 的IMP地址
  • 防止运行环境被破坏使用method_setImplementation构建block执行原函数
  • 寻找mach-o中的load以及Swizzle共耗时4毫秒

Podfile

To integrate TTAnalyzeLoadTime into your Xcode project using CocoaPods, specify it in your Podfile:

source 'https://github.com/CocoaPods/Specs.git'
platform :ios, '8.0'

target 'TargetName' do
pod 'TTAnalyzeLoadTime', '~> 1.0'
end

Then, run the following command:

$ pod install

Usage

#import <TTLoadTime/TTLoadTime.h>

printLoadCostsInfo();

TODO

  1. 白名单
  2. 格式化打印

参考文章

ttanalyzeloadtime's People

Contributors

huakucha avatar

Watchers

James Cloos avatar 子凡 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.