Git Product home page Git Product logo

apporderfiles's Introduction

Platform Version GitHub release Twitter Follow

AppOrderFiles

The easiest way to generate order files for Mach-O using Clang SanitizerCoverage. Improving your App Performance.

Enjoy it!!!

📚 Article

🌟 Feature

  • Swift/Objective-C/C/C++
  • All Methods and Functions
  • All Blocks
  • iOS/macOS/tvOS/watchOS

🐒 Usage

Just call AppOrderFiles().

AppOrderFiles(^(NSString *orderFilePath) {
    NSLog(@"OrderFilePath:%@", orderFilePath);
});

After generating "app.order" file, just move it to your project workspace, and fill in "Order File" in build settings.

AppOrderFiles also print results in debug console.

📲 Installation

NOTE: In build settings of your Xcode project/target, add -fsanitize-coverage=func,trace-pc-guard under "Other C Flags". If you are using Swift, also add -sanitize-coverage=func and -sanitize=undefined under "Other Swift Flags".

CocoaPods

CocoaPods is a dependency manager for Cocoa projects. You can install it with the following command:

$ gem install cocoapods

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

source 'https://github.com/CocoaPods/Specs.git'
platform :ios, '8.0'
use_frameworks!
target 'MyApp' do
	pod 'AppOrderFiles'
end

You need replace "MyApp" with your project's name.

Then, run the following command:

$ pod install

AppOrderFiles works under Clang SanitizerCoverage, you can modify Xcode build settings manually, or using Podfile.

post_install do |installer|
  installer.pods_project.targets.each do |target|
    target.build_configurations.each do |config|
      config.build_settings['OTHER_CFLAGS'] = '-fsanitize-coverage=func,trace-pc-guard'
      config.build_settings['OTHER_SWIFT_FLAGS'] = '-sanitize-coverage=func -sanitize=undefined'
    end
  end
end

📚 Reference

❤️ Contributed

  • If you need help or you'd like to ask a general question, open an issue.
  • If you found a bug, open an issue.
  • If you have a feature request, open an issue.
  • If you want to contribute, submit a pull request.

👨🏻‍💻 Author

yulingtianxia, [email protected]

apporderfiles's People

Contributors

yulingtianxia avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

apporderfiles's Issues

build setting配置

build setting配置是clang的参数,如果pod引入的就是framework,并不是源码的pod,这类的framework的库是否生效?

输出的order file文件只有_main

我们项目的工程是cocoapod管理, 除了main文件在主工程, 其他文件都分部在pods里, 我把工程配置好后运行, 发现输出的order file文件里只有_main, 这个的原因是什么, 怎么解决呢
是否只有在 Build phase->Compile Sources里的文件才能检测到

导入生成的order file 会报错

0 0x1049eb198 __assert_rtn + 127
1 0x1049f4f04 ld::passes::order::Layout::buildFollowOnTables() (.cold.5) + 0
2 0x1049c1de7 ld::passes::order::Layout::buildFollowOnTables() + 2209
3 0x1049c27c5 ld::passes::order::Layout::doPass() + 23
4 0x1049c28cd ld::passes::order::doPass(Options const&, ld::Internal&) + 151
5 0x1048ce113 main + 1001
6 0x7fff71a432e5 start + 1
ld: Assertion failed: (_followOnNexts.count(atom) == 0), function buildFollowOnTables, file /Library/Caches/com.apple.xbs/Sources/ld64/ld64-520/src/ld/passes/order.cpp, line 411.
clang: error: linker command failed with exit code 1 (use -v to see invocation)

重排后貌似没什么效果

测试数据(重排)

  1. EnterMain()—>1623.5341796875 coldLanuchFinished-->3591.0869140625
  2. EnterMain()—>1671.537841796875 coldLanuchFinished-->4203.284912109375
  3. EnterMain()—>1463.7109375 coldLanuchFinished-->3916.2109375
  4. EnterMain()—>1535.093994140625 coldLanuchFinished-->4235.630126953125
  5. EnterMain()—>1654.43505859375 coldLanuchFinished-->4197.576904296875
  6. EnterMain()—>1413.18115234375 coldLanuchFinished-->4113.499267578125

测试数据(非重排)

  1. EnterMain()—>1381.821044921875 coldLanuchFinished-->4133.60986328125
  2. EnterMain()—>1563.06591796875 coldLanuchFinished-->4042.641845703125
  3. EnterMain()—>1490.971923828125 coldLanuchFinished-->4021.407958984375
  4. EnterMain()—>1689.35498046875 coldLanuchFinished-->3937.9599609375
  5. EnterMain()—>1594.353271484375 coldLanuchFinished-->3975.540283203125

用模拟器跑了几次数据,发现差距并不明显

无法获取其他类的方法调用符合

这个只能获取到Main方法与Appdelegate里面的相关方法,ViewController以及其他类的调用方法都没有获取到。是我打开方式不对吗,比如在Demo里面的RootVC里面的ViewDidLoad添加一个新方法调用,就没有捕捉到。

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.