generated from Kotlin/multiplatform-library-template
-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Refactor * WIP: Improve benchmarks * WIP: Benchmarks * Fix DI * Prepare benchmarks * Remove upload step
- Loading branch information
1 parent
63d5b26
commit 60ac327
Showing
14 changed files
with
423 additions
and
60 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
53 changes: 53 additions & 0 deletions
53
benchmark/src/main/kotlin/ivy/di/benchmark/fixtures/BeGraph.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
package ivy.di.benchmark.fixtures | ||
|
||
class AwsUrlProvider : UrlProvider | ||
interface UrlProvider | ||
|
||
interface Environment | ||
class RealEnvironment : Environment | ||
|
||
class ServerConfig( | ||
val urlProvider: UrlProvider | ||
) | ||
|
||
class KtorApp | ||
class RateLimiter(val ktorApp: KtorApp) | ||
|
||
class Database( | ||
val config: ServerConfig, | ||
val logger: Logger, | ||
) | ||
|
||
class AuthRepository(val database: Database) | ||
class GoogleLoginUseCase(val database: Database, val httpClient: HttpClient) | ||
class AuthService( | ||
val repository: AuthRepository, | ||
val googleLoginUseCase: GoogleLoginUseCase, | ||
) | ||
class AuthApi( | ||
val authService: AuthService, | ||
val logger: Logger, | ||
val rateLimiter: RateLimiter | ||
) | ||
|
||
class CarsRepository( | ||
val database: Database, | ||
val logger: Logger, | ||
) | ||
class CarsService( | ||
val authService: AuthService, | ||
val repository: CarsRepository, | ||
) | ||
class CarsApi(val service: CarsService) | ||
|
||
class Apis( | ||
val rateLimiter: RateLimiter, | ||
val authApi: AuthApi, | ||
val carsApi: CarsApi, | ||
) | ||
class ServerApp( | ||
val serverConfig: ServerConfig, | ||
val ktorApp: KtorApp, | ||
val logger: Logger, | ||
val apis: Apis, | ||
) |
18 changes: 18 additions & 0 deletions
18
benchmark/src/main/kotlin/ivy/di/benchmark/fixtures/CommonGraph.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
package ivy.di.benchmark.fixtures | ||
|
||
|
||
interface DispatchersProvider | ||
class RealDispatchersProvider : DispatchersProvider | ||
|
||
interface Logger | ||
class LoggerImpl : Logger | ||
|
||
interface Serialization | ||
class Json | ||
class KotlinXSerialization(val json: Json) : Serialization | ||
|
||
class HttpClient( | ||
val serialization: Serialization, | ||
val logger: Logger, | ||
val dispatchersProvider: DispatchersProvider, | ||
) |
106 changes: 106 additions & 0 deletions
106
benchmark/src/main/kotlin/ivy/di/benchmark/fixtures/ComplexGraph.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,106 @@ | ||
package ivy.di.benchmark.fixtures | ||
|
||
class Holder1( | ||
val app: App, | ||
val serverApp: ServerApp, | ||
) | ||
|
||
class Holder2( | ||
val app: App, | ||
val serverApp: ServerApp, | ||
val holder1: Holder1, | ||
) | ||
|
||
class Holder3( | ||
val holder1: Holder1, | ||
val holder2: Holder2, | ||
) | ||
|
||
class Holder4( | ||
val holder1: Holder1, | ||
val holder2: Holder2, | ||
val holder3: Holder3, | ||
) | ||
|
||
class Holder5( | ||
val holder1: Holder1, | ||
val holder2: Holder2, | ||
val holder3: Holder3, | ||
val holder4: Holder4, | ||
) | ||
|
||
class Holder6( | ||
val holder1: Holder1, | ||
val holder2: Holder2, | ||
val holder3: Holder3, | ||
val holder4: Holder4, | ||
val holder5: Holder5, | ||
) | ||
|
||
class Holder7( | ||
val holder1: Holder1, | ||
val holder2: Holder2, | ||
val holder3: Holder3, | ||
val holder4: Holder4, | ||
val holder5: Holder5, | ||
val holder6: Holder6, | ||
) | ||
|
||
class Holder8( | ||
val holder1: Holder1, | ||
val holder2: Holder2, | ||
val holder3: Holder3, | ||
val holder4: Holder4, | ||
val holder5: Holder5, | ||
val holder6: Holder6, | ||
val holder7: Holder7, | ||
) | ||
|
||
class Holder9( | ||
val holder1: Holder1, | ||
val holder2: Holder2, | ||
val holder3: Holder3, | ||
val holder4: Holder4, | ||
val holder5: Holder5, | ||
val holder6: Holder6, | ||
val holder7: Holder7, | ||
val holder8: Holder8, | ||
) | ||
|
||
class Holder10( | ||
val holder1: Holder1, | ||
val holder2: Holder2, | ||
val holder3: Holder3, | ||
val holder4: Holder4, | ||
val holder5: Holder5, | ||
val holder6: Holder6, | ||
val holder7: Holder7, | ||
val holder8: Holder8, | ||
val holder9: Holder9, | ||
) | ||
|
||
interface MultiHolder | ||
class MultiHolderImpl( | ||
val holderA: Holder10, | ||
val holderB: Holder10, | ||
val holderC: Holder10, | ||
val holderD: Holder10, | ||
val holderE: Holder10, | ||
val holderF: Holder10, | ||
val holderG: Holder10, | ||
val holderH: Holder10, | ||
val holderI: Holder10, | ||
val holderJ: Holder10, | ||
val holderK: Holder10, | ||
val holderL: Holder10, | ||
val holderM: Holder10, | ||
val holderN: Holder10, | ||
) : MultiHolder | ||
|
||
class MultiHolderFinal( | ||
val holder1: MultiHolder, | ||
val holder2: MultiHolder, | ||
val holder3: MultiHolder, | ||
val holder4: MultiHolder, | ||
val holder5: MultiHolder, | ||
) |
Oops, something went wrong.