{"id":13465285,"url":"https://github.com/giginet/xcprofiler","last_synced_at":"2025-04-12T19:48:21.656Z","repository":{"id":56898690,"uuid":"77032655","full_name":"giginet/xcprofiler","owner":"giginet","description":":chart_with_upwards_trend: CLI to profile compilation time of Swift project","archived":false,"fork":false,"pushed_at":"2019-10-11T07:34:17.000Z","size":1101,"stargazers_count":338,"open_issues_count":6,"forks_count":12,"subscribers_count":8,"default_branch":"master","last_synced_at":"2025-04-12T19:48:16.851Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Ruby","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/giginet.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2016-12-21T08:25:30.000Z","updated_at":"2025-03-28T20:22:32.000Z","dependencies_parsed_at":"2022-08-20T17:40:41.208Z","dependency_job_id":null,"html_url":"https://github.com/giginet/xcprofiler","commit_stats":null,"previous_names":["giginet/xctracker"],"tags_count":14,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/giginet%2Fxcprofiler","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/giginet%2Fxcprofiler/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/giginet%2Fxcprofiler/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/giginet%2Fxcprofiler/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/giginet","download_url":"https://codeload.github.com/giginet/xcprofiler/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248625498,"owners_count":21135513,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-07-31T15:00:25.813Z","updated_at":"2025-04-12T19:48:21.637Z","avatar_url":"https://github.com/giginet.png","language":"Ruby","funding_links":[],"categories":["Benchmark","Benchmark [🔝](#readme)","Ruby","Developer Tools"],"sub_categories":["Vim"],"readme":"# xcprofiler\n\n[![Build Status](https://travis-ci.org/giginet/xcprofiler.svg?branch=master)](https://travis-ci.org/giginet/xcprofiler)\n[![Coverage Status](https://coveralls.io/repos/github/giginet/xcprofiler/badge.svg?branch=master)](https://coveralls.io/github/giginet/xcprofiler?branch=master)\n[![Gem Version](https://badge.fury.io/rb/xcprofiler.svg)](https://badge.fury.io/rb/xcprofiler)\n[![Gem Download](https://img.shields.io/gem/dt/xcprofiler.svg)](https://badge.fury.io/rb/xcprofiler)\n[![MIT License](http://img.shields.io/badge/license-MIT-blue.svg?style=flat)](LICENSE)\n\nCommand line utility to profile compilation time of Swift project.\n\n![](https://raw.githubusercontent.com/giginet/xcprofiler/master/assets/sample_output.png)\n\nThis tool is developed in working time for Cookpad.\n\n## Installation\n\n```\ngem install xcprofiler\n```\n\nxcprofiler is tested on latest Ruby 2.3/2.4.\n\n## Usage\n\n1. Add `-Xfrontend -debug-time-function-bodies` build flags in `Build Settings` -\u003e `Other Swift Flags` section of your Xcode project.\n    ![](https://raw.githubusercontent.com/giginet/xcprofiler/master/assets/build_flags.png)\n\n2. Build your project\n3. Execute `xcprofiler`\n\n```\n$ xcprofiler [PRODUCT_NAME or ACTIVITY_LOG_PATH] [options]\n```\n\n`xcprofiler` searches the latest build log on your DerivedData directory.\n\nYou can also specify the `.xcactivitylog`.\n\n```\n$ xcprofiler MyApp\n$ xcprofiler ~/Library/Developer/Xcode/DerivedData/MyApp-xxxxxxxxxxx/Logs/Build/0761C73D-3B6C-449A-BE89-6D11DAB748FE.xcactivitylog\n```\n\nSample output is here\n\n```\n+----------------------+------+---------------------------------------------------------------------------------------------------------------------------------------------------------------+----------+\n| File                 | Line | Method name                                                                                                                                                   | Time(ms) |\n+----------------------+------+---------------------------------------------------------------------------------------------------------------------------------------------------------------+----------+\n| ResultProtocol.swift | 132  | public func ==\u003cT : ResultProtocol where T.Value : Equatable, T.Error : Equatable\u003e(left: T, right: T) -\u003e Bool                                                  | 14.2     |\n| Result.swift         | 66   | get {}                                                                                                                                                        | 13.1     |\n| Result.swift         | 78   | public static func error(_ message: String? = default, function: String = #function, file: String = #file, line: Int = #line) -\u003e NSError                      | 6.3      |\n| Result.swift         | 69   | get {}                                                                                                                                                        | 2.2      |\n| Result.swift         | 132  | public func `try`\u003cT\u003e(_ function: String = #function, file: String = #file, line: Int = #line, try: (NSErrorPointer) -\u003e T?) -\u003e Result\u003cT, NSError\u003e              | 1.7      |\n| Result.swift         | 95   | get {}                                                                                                                                                        | 1.4      |\n| Result.swift         | 21   | public init(_ value: T?, failWith: @autoclosure () -\u003e Error)                                                                                                  | 0.9      |\n| Result.swift         | 142  | public func `try`(_ function: String = #function, file: String = #file, line: Int = #line, try: (NSErrorPointer) -\u003e Bool) -\u003e Result\u003c(), NSError\u003e              | 0.9      |\n| ResultProtocol.swift | 172  | @available(*, unavailable, renamed: \"recover(with:)\") public func recoverWith(_ result: @autoclosure () -\u003e Self) -\u003e Self                                      | 0.7      |\n| Result.swift         | 72   | get {}                                                                                                                                                        | 0.6      |\n| Result.swift         | 75   | get {}                                                                                                                                                        | 0.6      |\n| ResultProtocol.swift | 72   | public func recover(_ value: @autoclosure () -\u003e Value) -\u003e Value                                                                                               | 0.5      |\n| ResultProtocol.swift | 111  | public func \u0026\u0026\u0026\u003cL : ResultProtocol, R : ResultProtocol where L.Error == R.Error\u003e(left: L, right: @autoclosure () -\u003e R) -\u003e Result\u003c(L.Value, R.Value), L.Error\u003e | 0.5      |\n| ResultProtocol.swift | 144  | public func !=\u003cT : ResultProtocol where T.Value : Equatable, T.Error : Equatable\u003e(left: T, right: T) -\u003e Bool                                                  | 0.5      |\n| ResultProtocol.swift | 92   | public func tryMap\u003cU\u003e(_ transform: (Value) throws -\u003e U) -\u003e Result\u003cU, Error\u003e                                                                                   | 0.4      |\n| Result.swift         | 175  | @available(*, unavailable, renamed: \"success\") public static func Success(_: T) -\u003e Result\u003cT, Error\u003e                                                           | 0.3      |\n| ResultProtocol.swift | 55   | public func mapError\u003cError2\u003e(_ transform: (Error) -\u003e Error2) -\u003e Result\u003cValue, Error2\u003e                                                                         | 0.3      |\n| ResultProtocol.swift | 77   | public func recover(with result: @autoclosure () -\u003e Self) -\u003e Self                                                                                             | 0.3      |\n| ResultProtocol.swift | 93   | (closure)                                                                                                                                                     | 0.3      |\n| Result.swift         | 31   | public init(attempt f: () throws -\u003e T)                                                                                                                        | 0.2      |\n+----------------------+------+---------------------------------------------------------------------------------------------------------------------------------------------------------------+----------+\n```\n\n### Available Options\n\n|option|shorthand|description|\n|------|---------|-----------|\n|--limit|-l|Limit for display|\n|--threshold||Threshold of time to display (ms)|\n|--show-invalids||Show invalid location results|\n|--order|-o|Sort order (default,time,file)|\n|--derived-data-path||Root path of DerivedData directory|\n|--truncate-at|-t|Truncate the method name with specified length|\n|--no-unique||Show the duplicated results|\n\n## Use custom reporters\n\nYou can use reporters to output tracking logs.\n\n```ruby\nrequire 'xcprofiler'\n\nprofiler = Xcprofiler::Profiler.by_product_name('MyApp')\nprofiler.reporters = [\n  Xcprofiler::StandardOutputReporter.new(limit: 20, order: :time),\n  Xcprofiler::JSONReporter.new(output_path: 'result.json'),\n  Xcprofiler::BlockReporter.new do |executions|\n    do_something(executions)\n  end,\n]\nprofiler.report!\n```\n\nYou can also implement your own reporters.\n\nSee implementation of [built-in reporters](https://github.com/giginet/xcprofiler/tree/master/lib/xcprofiler/reporters) for detail.\n\n## danger-xcprofiler\n\nYou can integrate xcprofiler to [danger](https://github.com/danger/danger).\n\nhttps://github.com/giginet/danger-xcprofiler\n\n## License\n\nMIT License\n\n## Contributing\n\nBug reports and pull requests are welcome on GitHub at https://github.com/giginet/xcprofiler.\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgiginet%2Fxcprofiler","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fgiginet%2Fxcprofiler","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgiginet%2Fxcprofiler/lists"}