{"id":17211473,"url":"https://github.com/sloy/android-dependency-injection-performance","last_synced_at":"2025-04-06T18:17:03.310Z","repository":{"id":48731473,"uuid":"155579195","full_name":"Sloy/android-dependency-injection-performance","owner":"Sloy","description":"[NOT MAINTAINED] Measure the performance of several Dependency Injection frameworks in different devices","archived":false,"fork":false,"pushed_at":"2023-04-10T19:43:06.000Z","size":194,"stargazers_count":313,"open_issues_count":4,"forks_count":45,"subscribers_count":10,"default_branch":"master","last_synced_at":"2025-03-30T16:13:28.001Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Kotlin","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Sloy.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2018-10-31T15:19:51.000Z","updated_at":"2024-09-06T02:40:01.000Z","dependencies_parsed_at":"2024-10-31T05:00:33.599Z","dependency_job_id":"49026b0f-8f97-499b-b538-e36b4dfff250","html_url":"https://github.com/Sloy/android-dependency-injection-performance","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/Sloy%2Fandroid-dependency-injection-performance","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Sloy%2Fandroid-dependency-injection-performance/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Sloy%2Fandroid-dependency-injection-performance/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Sloy%2Fandroid-dependency-injection-performance/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Sloy","download_url":"https://codeload.github.com/Sloy/android-dependency-injection-performance/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247526768,"owners_count":20953143,"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-10-15T02:57:25.081Z","updated_at":"2025-04-06T18:17:03.287Z","avatar_url":"https://github.com/Sloy.png","language":"Kotlin","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Android Injection Performance\n\nThis project aims to measure the performance of several Dependency Injection frameworks (or Service Locators) in different devices.\n\n## Libraries tested\n- [Koin](https://insert-koin.io/) - 2.0.1\n- [Kodein](http://kodein.org/Kodein-DI/) - 6.3.3\n- [Dagger 2](https://google.github.io/dagger/) - 2.24\n- [Katana](https://github.com/rewe-digital-incubator/katana/) - 1.7.1\n\n## The test\nThe test data are classes with dependencies in a structure similar to Fibonacci sequence, to simulate multiple levels of transitive dependencies.\nFor each library there is a test with Kotlin classes and one with Java classes, because some libraries seem to be affected by this difference.\n\nEach test injects one of this dependencies 100 times and prints the maximum time, the minimum and the average.\n\nThe project contains an Android application that run the tests on its onCreate and prints the result to the Logcat.\n\nThe actual test is implemented in the class [InjectionTest.kt](https://github.com/Sloy/android-dependency-injection-performance/blob/master/app/src/main/java/com/sloydev/dependencyinjectionperformance/InjectionTest.kt)\n\n## Results\nResults can be quite different between different devices, so here are some results in different devices with different Android versions. Each table contains the **median** time of each library's setup and injection. More results are welcomed.\n\n- [Samsung Galaxy J5](#samsung-galaxy-j5)\n- [Samsung Galaxy S8](#samsung-galaxy-s8)\n- [Huawei P8 Lite](#huawei-p8-lite)\n- [Xiaomi MI A1](#xiaomi-mi-a1)\n- [OnePlus One](#oneplus-one)\n- [OnePlus 5](#oneplus-5)\n- [Nexus 6](#nexus-6)\n- [OnePlus 5T](#oneplus-5t) (dependencies updated)\n\n### Samsung Galaxy J5\nSamsung j5nlte with Android 6.0.1\n \nLibrary | Setup Kotlin | Setup Java | Inject Kotlin | Inject Java\n--- | ---:| ---:| ---:| ---:\n**Koin** | 51.47 ms | 53.65 ms  | 2.47 ms | 2.52 ms\n**Kodein** | 73.36 ms | 75.21 ms  | 9.89 ms | 9.58 ms\n**Katana** | 12.34 ms | 12.30 ms  | 2.00 ms | 1.94 ms\n**Custom** | 4.85 ms | 4.81 ms  | 0.73 ms | 0.84 ms\n**Dagger** | 0.02 ms | 0.02 ms  | 0.27 ms | 0.23 ms\n\n### Samsung Galaxy S8\nSamsung dreamlte with Android 8.0.0\n \nLibrary | Setup Kotlin | Setup Java | Inject Kotlin | Inject Java\n--- | ---:| ---:| ---:| ---:\n**Koin** | 5.68 ms | 6.04 ms  | 0.13 ms | 0.21 ms\n**Kodein** | 7.13 ms | 7.38 ms  | 0.20 ms | 0.21 ms\n**Katana** | 0.64 ms | 0.68 ms  | 0.21 ms | 0.16 ms\n**Custom** | 0.15 ms | 0.16 ms  | 0.11 ms | 0.11 ms\n**Dagger** | 0.01 ms | 0.01 ms  | 0.10 ms | 0.10 ms\n\n### Huawei P8 Lite\nHuawei hwALE-H with Android 6.0\n \nLibrary | Setup Kotlin | Setup Java | Inject Kotlin | Inject Java\n--- | ---:| ---:| ---:| ---:\n**Koin** | 12.12 ms | 12.34 ms  | 0.26 ms | 0.26 ms\n**Kodein** | 14.46 ms | 14.52 ms  | 0.80 ms | 0.79 ms\n**Katana** | 2.01 ms | 1.99 ms  | 0.18 ms | 0.18 ms\n**Custom** | 0.51 ms | 0.50 ms  | 0.08 ms | 0.09 ms\n**Dagger** | 0.00 ms | 0.00 ms  | 0.03 ms | 0.02 ms\n\n### Xiaomi MI A1\nXiaomi tissot_sprout with Android 8.1.0\n \nLibrary | Setup Kotlin | Setup Java | Inject Kotlin | Inject Java\n--- | ---:| ---:| ---:| ---:\n**Koin** | 9.17 ms | 11.10 ms  | 0.25 ms | 0.54 ms\n**Kodein** | 16.64 ms | 16.22 ms  | 0.82 ms | 0.32 ms\n**Katana** | 1.42 ms | 1.28 ms  | 0.31 ms | 0.31 ms\n**Custom** | 0.28 ms | 0.28 ms  | 0.19 ms | 0.23 ms\n**Dagger** | 0.02 ms | 0.02 ms  | 0.28 ms | 0.21 ms\n\n### OnePlus One\nOnePlus A0001 with Android 5.0.2\n \nLibrary | Setup Kotlin | Setup Java | Inject Kotlin | Inject Java\n--- | ---:| ---:| ---:| ---:\n**Koin** | 11.84 ms | 12.00 ms  | 0.27 ms | 0.30 ms\n**Kodein** | 22.52 ms | 23.05 ms  | 1.11 ms | 1.28 ms\n**Katana** | 1.87 ms | 1.58 ms  | 0.27 ms | 0.18 ms\n**Custom** | 0.43 ms | 0.35 ms  | 0.09 ms | 0.10 ms\n**Dagger** | 0.00 ms | 0.00 ms  | 0.04 ms | 0.04 ms\n\n### OnePlus 5\nOnePlus OnePlus5 with Android 8.1.0\n \nLibrary | Setup Kotlin | Setup Java | Inject Kotlin | Inject Java\n--- | ---:| ---:| ---:| ---:\n**Koin** | 2.27 ms | 2.46 ms  | 0.05 ms | 0.05 ms\n**Kodein** | 4.81 ms | 4.43 ms  | 0.09 ms | 0.08 ms\n**Katana** | 0.34 ms | 0.32 ms  | 0.04 ms | 0.04 ms\n**Custom** | 0.07 ms | 0.08 ms  | 0.02 ms | 0.03 ms\n**Dagger** | 0.00 ms | 0.00 ms  | 0.04 ms | 0.02 ms\n\n### Nexus 6\nGoogle shamu with Android 7.1.1\n \nLibrary | Setup Kotlin | Setup Java | Inject Kotlin | Inject Java\n--- | ---:| ---:| ---:| ---:\n**Koin** | 19.80 ms | 20.43 ms  | 0.45 ms | 0.35 ms\n**Kodein** | 21.48 ms | 21.02 ms  | 0.74 ms | 0.62 ms\n**Katana** | 1.23 ms | 1.16 ms  | 0.31 ms | 0.27 ms\n**Custom** | 0.29 ms | 0.29 ms  | 0.20 ms | 0.31 ms\n**Dagger** | 0.03 ms | 0.03 ms  | 0.22 ms | 0.15 ms\n\n### OnePlus 5T\nOnePlus OnePlus5T with Android 9.0\n \nLibrary | Setup Kotlin | Setup Java | Inject Kotlin | Inject Java\n--- | ---:| ---:| ---:| ---:\n**Koin** | 0.45 ms | 0.47 ms  | 0.06 ms | 0.05 ms\n**Kodein** | 5.21 ms | 5.30 ms  | 0.09 ms | 0.09 ms\n**Katana** | 0.34 ms | 0.37 ms  | 0.04 ms | 0.04 ms\n**Custom** | 0.08 ms | 0.08 ms  | 0.03 ms | 0.03 ms\n**Dagger** | 0.00 ms | 0.00 ms  | 0.03 ms | 0.04 ms\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsloy%2Fandroid-dependency-injection-performance","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsloy%2Fandroid-dependency-injection-performance","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsloy%2Fandroid-dependency-injection-performance/lists"}