GithubHelp home page GithubHelp logo

hiosdra / android-dependency-injection-performance Goto Github PK

View Code? Open in Web Editor NEW

This project forked from arnaudgiuliani/android-dependency-injection-performance

0.0 0.0 0.0 176 KB

Measure the performance of several Dependency Injection frameworks in different devices

Java 10.61% Kotlin 89.39%

android-dependency-injection-performance's Introduction

Android Injection Performance

This project aims to measure the performance of several Dependency Injection frameworks (or Service Locators) in different devices.

Libraries tested

The test

The test data are classes with dependencies in a structure similar to Fibonacci sequence, to simulate multiple levels of transitive dependencies. For each library there is a test with Kotlin classes and one with Java classes, because some libraries seem to be affected by this difference.

Each test injects one of this dependencies 100 times and prints the maximum time, the minimum and the average.

The project contains an Android application that run the tests on its onCreate and prints the result to the Logcat.

The actual test is implemented in the class InjectionTest.kt

Results

Results 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.

Samsung Galaxy J5

samsung j5nlte with Android 6.0.1

Library Setup Kotlin Setup Java Inject Kotlin Inject Java
Koin 50,86 ms 51,20 ms 12,00 ms 11,97 ms
Kodein 69,35 ms 69,30 ms 8,47 ms 8,39 ms
Katana 11,48 ms 11,42 ms 2,07 ms 2,04 ms
Custom 4,75 ms 4,78 ms 0,70 ms 0,84 ms
Dagger 0,02 ms 0,02 ms 0,25 ms 0,22 ms

Samsung Galaxy S8

samsung dreamlte with Android 8.0.0

Library Setup Kotlin Setup Java Inject Kotlin Inject Java
Koin 4,42 ms 4,54 ms 0,81 ms 0,87 ms
Kodein 5,28 ms 5,50 ms 0,14 ms 0,13 ms
Katana 0,47 ms 0,42 ms 0,07 ms 0,09 ms
Custom 0,11 ms 0,12 ms 0,05 ms 0,05 ms
Dagger 0,01 ms 0,01 ms 0,04 ms 0,04 ms

Huawei P8 Lite

Huawei hwALE-H with Android 6.0

Library Setup Kotlin Setup Java Inject Kotlin Inject Java
Koin 47,04 ms 47,68 ms 11,26 ms 10,89 ms
Kodein 64,97 ms 64,91 ms 7,58 ms 7,59 ms
Katana 10,37 ms 10,43 ms 1,93 ms 1,90 ms
Custom 4,32 ms 4,32 ms 0,65 ms 0,80 ms
Dagger 0,01 ms 0,01 ms 0,23 ms 0,20 ms

Xiaomi MI A1

xiaomi tissot_sprout with Android 8.1.0

Library Setup Kotlin Setup Java Inject Kotlin Inject Java
Koin 6,78 ms 6,78 ms 1,27 ms 1,31 ms
Kodein 11,18 ms 10,95 ms 0,29 ms 0,26 ms
Katana 0,97 ms 0,90 ms 0,13 ms 0,13 ms
Custom 0,24 ms 0,24 ms 0,08 ms 0,10 ms
Dagger 0,01 ms 0,01 ms 0,09 ms 0,05 ms

OnePlus One

oneplus A0001 with Android 5.0.2

Library Setup Kotlin Setup Java Inject Kotlin Inject Java
Koin 54,55 ms 59,10 ms 13,72 ms 14,30 ms
Kodein 78,66 ms 73,30 ms 8,79 ms 7,02 ms
Katana 12,08 ms 9,38 ms 2,02 ms 2,02 ms
Custom 4,27 ms 4,32 ms 0,70 ms 0,92 ms
Dagger 0,02 ms 0,02 ms 0,22 ms 0,19 ms

OnePlus 5

OnePlus OnePlus5 with Android 8.1.0

Library Setup Kotlin Setup Java Inject Kotlin Inject Java
Koin 3,09 ms 3,02 ms 0,54 ms 0,58 ms
Kodein 4,78 ms 4,66 ms 0,11 ms 0,10 ms
Katana 0,33 ms 0,32 ms 0,06 ms 0,07 ms
Custom 0,08 ms 0,08 ms 0,04 ms 0,04 ms
Dagger 0,01 ms 0,01 ms 0,05 ms 0,04 ms

Nexus 6

google shamu with Android 7.1.1

Library Setup Kotlin Setup Java Inject Kotlin Inject Java
Koin 17,49 ms 18,83 ms 3,13 ms 4,32 ms
Kodein 17,48 ms 15,95 ms 0,60 ms 0,47 ms
Katana 0,97 ms 0,97 ms 0,54 ms 0,59 ms
Custom 0,20 ms 0,21 ms 0,20 ms 0,20 ms
Dagger 0,02 ms 0,02 ms 0,22 ms 0,13 ms

android-dependency-injection-performance's People

Contributors

sloy avatar svenjacobs avatar

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.