Code Monkey home page Code Monkey logo

hll-wp-guldan-ios's Introduction

license Pod Version Platform Language


Introduce

guldan is an open source time-consuming analysis tool for iOS Objective-C method. It can facilitate development/testing students to quickly obtain the cost time of all OC methods within a certain period of time when the APP is running, and supports visualization. see more: juejin paper

Compare

scheme compare advantage shortcomint
static instrumentation The entry edge and exit edge of the function can be overwritten, and the entire execution process of the function can be covered Negative impact on package volume; cannot be applied to closed source libraries; high access cost
Messier Analysis product visualization, with time series Relying on third-party maintenance, some iOS systems cannot be applied
Xcode Instruments Powerful functions and support for sub-thread analysis High cost of use; unsustainable analysis results; does not support timing
our scheme Low invasiveness, high performance, low cost of use, visualization Does not support simulators, only for OC methods time-consuming

Features

  • Low intrusion: Hook objc_megSend is used to collect time-consuming data without intrusion to business target code;
  • High performance: The core code is implemented in assembly language, and the performance is guaranteed;
  • Visualization: Supports visualization of analysis results on desktop and mobile;
  • Support sub-threads: In addition to the method time-consuming analysis of the main thread, it also supports the method time-consuming analysis of sub-threads;

Dependency

  • Real device and some simulators

Usage

(1) Install via CocoaPods command

pod 'Guldan'

(2) import header file

#import <Guldan/GDNOCMethodTimeProfiler.h>

(3)start analysis

[GDNOCMethodTimeProfiler start];

(4)stop analysis

[GDNOCMethodTimeProfiler stop];

(5)output result path

[GDNOCMethodTimeProfiler handleRecordsWithComplete:^(NSArray<NSString *> * _Nonnull filePaths) {
    // file path
}];

(6)output file path It can be opened quickly with the help of some sandbox tools. The sandbox directory can also be downloaded using Xcode. Here is only how to use Xcode to find the result file in the sandbox. Xcode window/Devices and Simulators/select target APP/Click the gear icon and select「Download Container」

Right-click the file downloaded in the previous step, select "Show Package Contents" and find the oc_method_cost_mainthread file

(7)Desktop visualization with Chrome Enter chrome://tracing/ in the chrome browser and drag in the oc_method_cost_mainthread file。

Author

   HUOLALA mobile technology team

License

  Guldan is released under the Apache 2.0 license. See LICENSE for details.

hll-wp-guldan-ios's People

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.