{"id":19731775,"url":"https://github.com/layoutbox/layoutframeworkbenchmark","last_synced_at":"2025-04-05T17:07:37.832Z","repository":{"id":41461658,"uuid":"101293026","full_name":"layoutBox/LayoutFrameworkBenchmark","owner":"layoutBox","description":"Benchmark the performances of various Swift layout frameworks (autolayout, UIStackView, PinLayout, LayoutKit, FlexLayout, Yoga, ...)","archived":false,"fork":false,"pushed_at":"2022-07-22T15:31:42.000Z","size":6668,"stargazers_count":435,"open_issues_count":3,"forks_count":34,"subscribers_count":11,"default_branch":"master","last_synced_at":"2025-03-29T16:07:19.619Z","etag":null,"topics":["autolayout","benchmark","benchmark-data","flex-layout","flexlayout","ios","layout","layoutkit","layoutkit-benchmark","osx","pin-layout","pinlayout","swift","tvos","uistackview","yoga","yogakit"],"latest_commit_sha":null,"homepage":"","language":"Swift","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"bsd-3-clause","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/layoutBox.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":"2017-08-24T12:34:17.000Z","updated_at":"2025-01-30T12:02:09.000Z","dependencies_parsed_at":"2022-09-08T21:42:35.090Z","dependency_job_id":null,"html_url":"https://github.com/layoutBox/LayoutFrameworkBenchmark","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/layoutBox%2FLayoutFrameworkBenchmark","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/layoutBox%2FLayoutFrameworkBenchmark/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/layoutBox%2FLayoutFrameworkBenchmark/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/layoutBox%2FLayoutFrameworkBenchmark/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/layoutBox","download_url":"https://codeload.github.com/layoutBox/LayoutFrameworkBenchmark/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247369952,"owners_count":20927928,"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":["autolayout","benchmark","benchmark-data","flex-layout","flexlayout","ios","layout","layoutkit","layoutkit-benchmark","osx","pin-layout","pinlayout","swift","tvos","uistackview","yoga","yogakit"],"created_at":"2024-11-12T00:23:01.754Z","updated_at":"2025-04-05T17:07:37.805Z","avatar_url":"https://github.com/layoutBox.png","language":"Swift","readme":"\u003cp align=\"center\"\u003e\n  \u003ca href=\"https://github.com/layoutBox/LayoutFrameworkBenchmark\"\u003e\u003cimg src=\"docs_markdown/images/logo.png\" alt=\"FlexLayout\" width=\"270\"/\u003e\u003c/a\u003e\n\u003c/p\u003e\n\n\u003ch1 align=\"center\" style=\"color: #376C9D; font-family: Arial Black, Gadget, sans-serif; font-size: 2em\"\u003eLayout Framework Benchmark\u003c/h1\u003e\n \n\u003cp align=\"center\"\u003e\n  \u003ca href=\"\"\u003e\u003cimg src=\"https://img.shields.io/cocoapods/p/FlexLayout.svg?style=flat\" /\u003e\u003c/a\u003e\n  \u003ca href=\"https://travis-ci.org/layoutBox/LayoutFrameworkBenchmark\"\u003e\u003cimg src=\"https://travis-ci.org/layoutBox/LayoutFrameworkBenchmark.svg?branch=master\" /\u003e\u003c/a\u003e\n  \u003ca href=\"https://raw.githubusercontent.com/layoutBox/LayoutFrameworkBenchmark/master/LICENSE\"\u003e\u003cimg src=\"https://img.shields.io/badge/license-New%20BSD-blue.svg?style=flat\" /\u003e\u003c/a\u003e\n\u003c/p\u003e\n\n\u003cbr\u003e\n\nBenchmark the performances of various Swift layout frameworks.\n\n### Requirements\n* iOS 8.0+\n* Xcode 8.0+\n* Swift 3.0+\n\n# History \u003ca name=\"history\"\u003e\u003c/a\u003e\nThis project is a spin-off of the excellent [LayoutKit benchmark](https://github.com/linkedin/LayoutKit). The benchmark has been extracted to add other iOS layout frameworks and to compare them.\n\n\u003cbr\u003e\n\n# Why?\nChoosing the right layout framework for your project is an important decision. The frameworks API is quite important, but its performance is also important. To help you with that decision, this benchmark compare different layout frameworks.\n\n\u003cbr\u003e\n\n## Benchmark charts  \n\n\n##### General comparison\n\nThis chart display a general comparison between device performance using each layout frameworks.\nIt displays the performance when layouting UICollectionView cells. This graph shows performance when layouting 100 UICollectionView cells.\n\nThe **Y axis** indicates the **number of seconds** to render all cells.\n\n\u003ca href=\"docs_markdown/benchmark_comparison_all.png\"\u003e\u003cimg src=\"docs_markdown/benchmark_comparison_all.png\"/\u003e\u003c/a\u003e\n\u003cbr\u003e\n\n\n# Layout frameworks  \u003ca name=\"layout_frameworks\"\u003e\u003c/a\u003e\n\n**The benchmark currently includes the following layout frameworks:**  \n(ordered alphabetically and use the framework GitHub's description):\n\n* **Auto layout**  \nApple's auto layout constraints.  \n[Auto layout benchmark's source code](https://github.com/layoutBox/LayoutFrameworkBenchmark/blob/master/LayoutFrameworkBenchmark/Benchmarks/AutoLayout/FeedItemAutoLayoutView.swift)\n\n* [**FlexLayout**](https://github.com/layoutBox/FlexLayout)  \nFlexLayout adds a nice Swift interface to the highly optimized [Yoga](https://github.com/facebook/yoga) flexbox implementation. Concise, intuitive \u0026 chainable syntax.  \n[FlexLayout benchmark's source code](https://github.com/layoutBox/LayoutFrameworkBenchmark/blob/master/LayoutFrameworkBenchmark/Benchmarks/FlexLayout/FeedItemFlexLayoutView.swift)\n\n* [**LayoutKit**](https://github.com/linkedin/LayoutKit)  \nLayoutKit is a fast view layout library for iOS, macOS, and tvOS.   \n[LayoutKit benchmark's source code](https://github.com/layoutBox/LayoutFrameworkBenchmark/tree/master/LayoutFrameworkBenchmark/Benchmarks/LayoutKit)\n\n* **Manual layout**  \nLayout is done by setting UIView's frame property directly. This implementation comes directly from the LayoutKit benchmark.\n[Manual layout benchmark's source code](https://github.com/layoutBox/LayoutFrameworkBenchmark/blob/master/LayoutFrameworkBenchmark/Benchmarks/ManualLayout/FeedItemManualView.swift)\n\n* [**NKFrameLayoutKit**](https://github.com/kennic/NKFrameLayoutKit)  \nNKFrameLayoutKit is a fast and easy to use layout library  \n[NKFrameLayoutKit benchmark's source code](https://github.com/layoutBox/LayoutFrameworkBenchmark/blob/master/LayoutFrameworkBenchmark/Benchmarks/NKFrameLayoutKit/NKFrameLayoutKitView.swift)\n\n* [**NotAutoLayout**](https://github.com/el-hoshino/NotAutoLayout)  \nLayout your views without Auto Layout constraints, in a much more swifty way.  \n[NotAutoLayout benchmark's source code](https://github.com/layoutBox/LayoutFrameworkBenchmark/blob/master/LayoutFrameworkBenchmark/Benchmarks/NotAutoLayout/FeedItemNotAutoLayoutView.swift)\n\n* [**PinLayout**](https://github.com/layoutBox/PinLayout)  \nFast Swift UIViews layouting without auto layout. No magic, pure code, full control and blazing fast. Concise syntax, intuitive, readable \u0026 chainable.  \n[PinLayout benchmark's source code](https://github.com/layoutBox/LayoutFrameworkBenchmark/blob/master/LayoutFrameworkBenchmark/Benchmarks/PinLayout/FeedItemPinLayoutView.swift)\n\n* [**Texture**](https://github.com/TextureGroup/Texture)  \nOptimize your app by making user interfaces thread safe, which means that you will be able to shift all expensive views into background threads.  \n[Texture benchmark's source code](https://github.com/layoutBox/LayoutFrameworkBenchmark/blob/master/LayoutFrameworkBenchmark/FeedItemTextureNode.swift)\n\n* **UIStackViews**  \nApple's UIStackViews.  \n[UIStackViews benchmark's source code](https://github.com/layoutBox/LayoutFrameworkBenchmark/blob/master/LayoutFrameworkBenchmark/Benchmarks/UIStackView/FeedItemUIStackView.swift)\n\n* [**Yoga**](https://github.com/facebook/yoga)  \nYoga's performance hasn't been tested directly, but FlexLayout has. FlexLayout is a light Swift interface for Yoga. \n\n\n:pushpin: Anyone who would like to integrate any other layout frameworks to this GitHub project is welcome.\n\n\u003cbr\u003e\n\n## Benchmark details\nThe benchmark layout UICollectionView cells in multiple pass, each pass contains more cells than the previous one. \n\n## Benchmark cell's layout\nHere are the benchmark rendering results to compare visual results:\n \n* [LayoutKit rendering result](docs_markdown/benchmark_result_LayoutKit.png)\n* [Manual layout rendering result](docs_markdown/benchmark_result_ManualLayout.png)\n* [NKFrameLayoutKit rendering result](docs_markdown/benchmark_result_NKFrameLayoutKit.png)\n* [PinLayout rendering result](docs_markdown/benchmark_result_PinLayout.png)\n* [Texture rendering result](docs_markdown/benchmark_result_Texture.png)\n\n:pushpin: Some work would be required to adjust the layout so that they all match perfectly. \n\n\u003cbr\u003e\n\n## Benchmark data  \nYou can see the benchmark's data and charts in this **[Google Spreadsheet Document](https://docs.google.com/spreadsheets/d/1sUNdGWBM-d_W13yC7VcfkRXC3owCVsnIublnfW-4xn4/edit#gid=1032991425)**.\n\n\u003cbr\u003e\n\n##### Details for different devices\n\nThe **X axis** in following charts indicates the **number of cells** contained for each pass. The **Y axis** indicates the **number of seconds** to render all cells from one pass.\n\n\u003ca href=\"docs_markdown/benchmark_iphonexs.png\"\u003e\u003cimg src=\"docs_markdown/benchmark_iphonexs.png\"/\u003e\u003c/a\u003e\n\u003cbr\u003e\n\n\n\u003ca href=\"docs_markdown/benchmark_iphonex.png\"\u003e\u003cimg src=\"docs_markdown/benchmark_iphonex.png\"/\u003e\u003c/a\u003e\n\u003cbr\u003e\n\n\u003ca href=\"docs_markdown/benchmark_iphone7.png\"\u003e\u003cimg src=\"docs_markdown/benchmark_iphone7.png\"/\u003e\u003c/a\u003e\n\u003cbr\u003e\n\n\u003ca href=\"docs_markdown/benchmark_iphone6s.png\"\u003e\u003cimg src=\"docs_markdown/benchmark_iphone6s.png\"/\u003e\u003c/a\u003e\n\u003cbr\u003e\n\n\u003ca href=\"docs_markdown/benchmark_iphone6.png\"\u003e\u003cimg src=\"docs_markdown/benchmark_iphone6.png\"/\u003e\u003c/a\u003e\n\u003cbr\u003e\n\n\u003ca href=\"docs_markdown/benchmark_iphone5s.png\"\u003e\u003cimg src=\"docs_markdown/benchmark_iphone5s.png\"/\u003e\u003c/a\u003e\n\u003cbr\u003e\n\n\n## Project's TODO list\n\n* Create a reference layout and update layout codes to match that reference.\n* Display benchmark charts inside the app and being to able to export them.\n* Export benchmark data to a spreadsheet.\n* Add more layout frameworks.\n* OSX support.\n* tvOS support.\n* ...\n\n\u003cbr\u003e\n\n## Contributing, comments, ideas, suggestions, issues, .... \u003ca name=\"comments\"\u003e\u003c/a\u003e\nFor any **comments**, **ideas**, **suggestions**, simply open an [issue](https://github.com/layoutBox/LayoutFrameworkBenchmark/issues). \n\nIf you'd like to contribute by adding other layout framework, you're welcomed!\n\n\u003cbr\u003e\n\n## Adding another layout framework\n\nThe process is currently tedious...\n \n* Add an implementation of the reference view.\n* Run on all reference devices (or at least the two latest generation) in **Release mode**.\n* Select the new layout from the Benchmark App.\n* Update the XLSX document.\n* Add a new chart\n* Save the chart using \"Save as Picture...\"\n* Update the README.md\n* Create a pull request.\n\n## License\nBSD 3-Clause License \n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flayoutbox%2Flayoutframeworkbenchmark","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Flayoutbox%2Flayoutframeworkbenchmark","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flayoutbox%2Flayoutframeworkbenchmark/lists"}