Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Sign in
Toggle navigation
F
Front-End
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
abdullh.alsoleman
Front-End
Commits
e89b1513
Unverified
Commit
e89b1513
authored
Feb 09, 2021
by
gaaclarke
Committed by
GitHub
Feb 09, 2021
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Added memory benchmark for flutter engine groups. (#75374)
parent
e8d52be5
Changes
22
Hide whitespace changes
Inline
Side-by-side
Showing
22 changed files
with
794 additions
and
0 deletions
+794
-0
.gitignore
dev/benchmarks/multiple_flutters/android/.gitignore
+15
-0
.gitignore
dev/benchmarks/multiple_flutters/android/app/.gitignore
+1
-0
build.gradle
dev/benchmarks/multiple_flutters/android/app/build.gradle
+54
-0
proguard-rules.pro
...nchmarks/multiple_flutters/android/app/proguard-rules.pro
+21
-0
AndroidManifest.xml
...ultiple_flutters/android/app/src/main/AndroidManifest.xml
+26
-0
App.kt
...oid/app/src/main/java/dev/flutter/multipleflutters/App.kt
+22
-0
MainActivity.kt
...rc/main/java/dev/flutter/multipleflutters/MainActivity.kt
+75
-0
ic_launcher_foreground.xml
.../app/src/main/res/drawable-v24/ic_launcher_foreground.xml
+34
-0
ic_launcher_background.xml
...roid/app/src/main/res/drawable/ic_launcher_background.xml
+173
-0
themes.xml
...flutters/android/app/src/main/res/values-night/themes.xml
+20
-0
colors.xml
...tiple_flutters/android/app/src/main/res/values/colors.xml
+13
-0
strings.xml
...iple_flutters/android/app/src/main/res/values/strings.xml
+7
-0
themes.xml
...tiple_flutters/android/app/src/main/res/values/themes.xml
+20
-0
build.gradle
dev/benchmarks/multiple_flutters/android/build.gradle
+30
-0
gradle.properties
dev/benchmarks/multiple_flutters/android/gradle.properties
+21
-0
gradle-wrapper.properties
...flutters/android/gradle/wrapper/gradle-wrapper.properties
+6
-0
settings.gradle
dev/benchmarks/multiple_flutters/android/settings.gradle
+11
-0
.gitignore
dev/benchmarks/multiple_flutters/module/.gitignore
+48
-0
.metadata
dev/benchmarks/multiple_flutters/module/.metadata
+10
-0
main.dart
dev/benchmarks/multiple_flutters/module/lib/main.dart
+71
-0
pubspec.yaml
dev/benchmarks/multiple_flutters/module/pubspec.yaml
+29
-0
flutter_engine_group_performance.dart
...devicelab/bin/tasks/flutter_engine_group_performance.dart
+87
-0
No files found.
dev/benchmarks/multiple_flutters/android/.gitignore
0 → 100644
View file @
e89b1513
*.iml
.gradle
/local.properties
/.idea/caches
/.idea/libraries
/.idea/modules.xml
/.idea/workspace.xml
/.idea/navEditor.xml
/.idea/assetWizardSettings.xml
.DS_Store
/build
/captures
.externalNativeBuild
.cxx
local.properties
dev/benchmarks/multiple_flutters/android/app/.gitignore
0 → 100644
View file @
e89b1513
/build
\ No newline at end of file
dev/benchmarks/multiple_flutters/android/app/build.gradle
0 → 100644
View file @
e89b1513
// Copyright 2014 The Flutter Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
plugins
{
id
'com.android.application'
id
'kotlin-android'
}
android
{
signingConfigs
{
self
{
}
}
compileSdkVersion
30
defaultConfig
{
applicationId
"dev.flutter.multipleflutters"
minSdkVersion
24
targetSdkVersion
30
versionCode
1
versionName
"1.0"
testInstrumentationRunner
"androidx.test.runner.AndroidJUnitRunner"
}
buildTypes
{
release
{
minifyEnabled
false
proguardFiles
getDefaultProguardFile
(
'proguard-android-optimize.txt'
),
'proguard-rules.pro'
signingConfig
debug
.
signingConfig
}
}
compileOptions
{
sourceCompatibility
JavaVersion
.
VERSION_1_8
targetCompatibility
JavaVersion
.
VERSION_1_8
}
kotlinOptions
{
jvmTarget
=
'1.8'
}
}
dependencies
{
implementation
"org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version"
implementation
'androidx.core:core-ktx:1.2.0'
implementation
'androidx.appcompat:appcompat:1.1.0'
implementation
'com.google.android.material:material:1.1.0'
implementation
'androidx.constraintlayout:constraintlayout:1.1.3'
testImplementation
'junit:junit:4.+'
androidTestImplementation
'androidx.test.ext:junit:1.1.1'
androidTestImplementation
'androidx.test.espresso:espresso-core:3.2.0'
implementation
project
(
':flutter'
)
}
\ No newline at end of file
dev/benchmarks/multiple_flutters/android/app/proguard-rules.pro
0 → 100644
View file @
e89b1513
# Add project specific ProGuard rules here.
# You can control the set of applied configuration files using the
# proguardFiles setting in build.gradle.
#
# For more details, see
# http://developer.android.com/guide/developing/tools/proguard.html
# If your project uses WebView with JS, uncomment the following
# and specify the fully qualified class name to the JavaScript interface
# class:
#-keepclassmembers class fqcn.of.javascript.interface.for.webview {
# public *;
#}
# Uncomment this to preserve the line number information for
# debugging stack traces.
#-keepattributes SourceFile,LineNumberTable
# If you keep the line number information, uncomment this to
# hide the original source file name.
#-renamesourcefileattribute SourceFile
\ No newline at end of file
dev/benchmarks/multiple_flutters/android/app/src/main/AndroidManifest.xml
0 → 100644
View file @
e89b1513
<!-- Copyright 2014 The Flutter Authors. All rights reserved.
Use of this source code is governed by a BSD-style license that can be
found in the LICENSE file. -->
<manifest
xmlns:android=
"http://schemas.android.com/apk/res/android"
package=
"dev.flutter.multipleflutters"
>
<application
android:name=
".App"
android:allowBackup=
"true"
android:label=
"@string/app_name"
android:supportsRtl=
"true"
android:theme=
"@style/Theme.MultipleFlutters"
>
<activity
android:name=
".MainActivity"
android:configChanges=
"orientation|keyboardHidden|keyboard|screenSize|locale|layoutDirection|fontScale|screenLayout|density|uiMode"
android:hardwareAccelerated=
"true"
android:windowSoftInputMode=
"adjustResize"
>
<intent-filter>
<action
android:name=
"android.intent.action.MAIN"
/>
<category
android:name=
"android.intent.category.LAUNCHER"
/>
</intent-filter>
</activity>
</application>
</manifest>
\ No newline at end of file
dev/benchmarks/multiple_flutters/android/app/src/main/java/dev/flutter/multipleflutters/App.kt
0 → 100644
View file @
e89b1513
// Copyright 2014 The Flutter Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
package
dev.flutter.multipleflutters
import
android.app.Application
import
io.flutter.embedding.engine.FlutterEngineGroup
/**
* Application class for this app.
*
* This holds onto our engine group.
*/
class
App
:
Application
()
{
lateinit
var
engines
:
FlutterEngineGroup
override
fun
onCreate
()
{
super
.
onCreate
()
engines
=
FlutterEngineGroup
(
this
)
}
}
dev/benchmarks/multiple_flutters/android/app/src/main/java/dev/flutter/multipleflutters/MainActivity.kt
0 → 100644
View file @
e89b1513
// Copyright 2014 The Flutter Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
package
dev.flutter.multipleflutters
import
android.content.Intent
import
androidx.appcompat.app.AppCompatActivity
import
android.os.Bundle
import
android.view.View
import
android.widget.FrameLayout
import
android.widget.LinearLayout
import
android.widget.TextView
import
androidx.fragment.app.FragmentActivity
import
androidx.fragment.app.FragmentManager
import
io.flutter.FlutterInjector
import
io.flutter.embedding.android.FlutterFragment
import
io.flutter.embedding.engine.FlutterEngineCache
import
io.flutter.embedding.engine.dart.DartExecutor
class
MainActivity
:
FragmentActivity
()
{
private
val
numberOfFlutters
=
2
override
fun
onCreate
(
savedInstanceState
:
Bundle
?)
{
super
.
onCreate
(
savedInstanceState
)
val
root
=
LinearLayout
(
this
)
root
.
layoutParams
=
LinearLayout
.
LayoutParams
(
LinearLayout
.
LayoutParams
.
MATCH_PARENT
,
LinearLayout
.
LayoutParams
.
MATCH_PARENT
)
root
.
orientation
=
LinearLayout
.
VERTICAL
root
.
weightSum
=
numberOfFlutters
.
toFloat
()
val
fragmentManager
:
FragmentManager
=
supportFragmentManager
setContentView
(
root
)
val
app
=
applicationContext
as
App
val
dartEntrypoint
=
DartExecutor
.
DartEntrypoint
(
FlutterInjector
.
instance
().
flutterLoader
().
findAppBundlePath
(),
"main"
)
val
topEngine
=
app
.
engines
.
createAndRunEngine
(
this
,
dartEntrypoint
)
val
bottomEngine
=
app
.
engines
.
createAndRunEngine
(
this
,
dartEntrypoint
)
for
(
i
in
0
until
numberOfFlutters
)
{
val
flutterContainer
=
FrameLayout
(
this
)
root
.
addView
(
flutterContainer
)
flutterContainer
.
id
=
12345
+
i
flutterContainer
.
layoutParams
=
LinearLayout
.
LayoutParams
(
FrameLayout
.
LayoutParams
.
MATCH_PARENT
,
FrameLayout
.
LayoutParams
.
MATCH_PARENT
,
1.0f
)
val
engine
=
if
(
i
==
0
)
topEngine
else
bottomEngine
FlutterEngineCache
.
getInstance
().
put
(
i
.
toString
(),
engine
)
val
flutterFragment
=
FlutterFragment
.
withCachedEngine
(
i
.
toString
()).
build
<
FlutterFragment
>()
fragmentManager
.
beginTransaction
()
.
add
(
12345
+
i
,
flutterFragment
)
.
commit
()
}
}
override
fun
onDestroy
()
{
for
(
i
in
0
until
numberOfFlutters
)
{
FlutterEngineCache
.
getInstance
().
remove
(
i
.
toString
())
}
super
.
onDestroy
()
}
}
dev/benchmarks/multiple_flutters/android/app/src/main/res/drawable-v24/ic_launcher_foreground.xml
0 → 100644
View file @
e89b1513
<!-- Copyright 2014 The Flutter Authors. All rights reserved.
Use of this source code is governed by a BSD-style license that can be
found in the LICENSE file. -->
<vector
xmlns:android=
"http://schemas.android.com/apk/res/android"
xmlns:aapt=
"http://schemas.android.com/aapt"
android:width=
"108dp"
android:height=
"108dp"
android:viewportWidth=
"108"
android:viewportHeight=
"108"
>
<path
android:pathData=
"M31,63.928c0,0 6.4,-11 12.1,-13.1c7.2,-2.6 26,-1.4 26,-1.4l38.1,38.1L107,108.928l-32,-1L31,63.928z"
>
<aapt:attr
name=
"android:fillColor"
>
<gradient
android:endX=
"85.84757"
android:endY=
"92.4963"
android:startX=
"42.9492"
android:startY=
"49.59793"
android:type=
"linear"
>
<item
android:color=
"#44000000"
android:offset=
"0.0"
/>
<item
android:color=
"#00000000"
android:offset=
"1.0"
/>
</gradient>
</aapt:attr>
</path>
<path
android:fillColor=
"#FFFFFF"
android:fillType=
"nonZero"
android:pathData=
"M65.3,45.828l3.8,-6.6c0.2,-0.4 0.1,-0.9 -0.3,-1.1c-0.4,-0.2 -0.9,-0.1 -1.1,0.3l-3.9,6.7c-6.3,-2.8 -13.4,-2.8 -19.7,0l-3.9,-6.7c-0.2,-0.4 -0.7,-0.5 -1.1,-0.3C38.8,38.328 38.7,38.828 38.9,39.228l3.8,6.6C36.2,49.428 31.7,56.028 31,63.928h46C76.3,56.028 71.8,49.428 65.3,45.828zM43.4,57.328c-0.8,0 -1.5,-0.5 -1.8,-1.2c-0.3,-0.7 -0.1,-1.5 0.4,-2.1c0.5,-0.5 1.4,-0.7 2.1,-0.4c0.7,0.3 1.2,1 1.2,1.8C45.3,56.528 44.5,57.328 43.4,57.328L43.4,57.328zM64.6,57.328c-0.8,0 -1.5,-0.5 -1.8,-1.2s-0.1,-1.5 0.4,-2.1c0.5,-0.5 1.4,-0.7 2.1,-0.4c0.7,0.3 1.2,1 1.2,1.8C66.5,56.528 65.6,57.328 64.6,57.328L64.6,57.328z"
android:strokeWidth=
"1"
android:strokeColor=
"#00000000"
/>
</vector>
\ No newline at end of file
dev/benchmarks/multiple_flutters/android/app/src/main/res/drawable/ic_launcher_background.xml
0 → 100644
View file @
e89b1513
<!-- Copyright 2014 The Flutter Authors. All rights reserved.
Use of this source code is governed by a BSD-style license that can be
found in the LICENSE file. -->
<vector
xmlns:android=
"http://schemas.android.com/apk/res/android"
android:width=
"108dp"
android:height=
"108dp"
android:viewportWidth=
"108"
android:viewportHeight=
"108"
>
<path
android:fillColor=
"#3DDC84"
android:pathData=
"M0,0h108v108h-108z"
/>
<path
android:fillColor=
"#00000000"
android:pathData=
"M9,0L9,108"
android:strokeWidth=
"0.8"
android:strokeColor=
"#33FFFFFF"
/>
<path
android:fillColor=
"#00000000"
android:pathData=
"M19,0L19,108"
android:strokeWidth=
"0.8"
android:strokeColor=
"#33FFFFFF"
/>
<path
android:fillColor=
"#00000000"
android:pathData=
"M29,0L29,108"
android:strokeWidth=
"0.8"
android:strokeColor=
"#33FFFFFF"
/>
<path
android:fillColor=
"#00000000"
android:pathData=
"M39,0L39,108"
android:strokeWidth=
"0.8"
android:strokeColor=
"#33FFFFFF"
/>
<path
android:fillColor=
"#00000000"
android:pathData=
"M49,0L49,108"
android:strokeWidth=
"0.8"
android:strokeColor=
"#33FFFFFF"
/>
<path
android:fillColor=
"#00000000"
android:pathData=
"M59,0L59,108"
android:strokeWidth=
"0.8"
android:strokeColor=
"#33FFFFFF"
/>
<path
android:fillColor=
"#00000000"
android:pathData=
"M69,0L69,108"
android:strokeWidth=
"0.8"
android:strokeColor=
"#33FFFFFF"
/>
<path
android:fillColor=
"#00000000"
android:pathData=
"M79,0L79,108"
android:strokeWidth=
"0.8"
android:strokeColor=
"#33FFFFFF"
/>
<path
android:fillColor=
"#00000000"
android:pathData=
"M89,0L89,108"
android:strokeWidth=
"0.8"
android:strokeColor=
"#33FFFFFF"
/>
<path
android:fillColor=
"#00000000"
android:pathData=
"M99,0L99,108"
android:strokeWidth=
"0.8"
android:strokeColor=
"#33FFFFFF"
/>
<path
android:fillColor=
"#00000000"
android:pathData=
"M0,9L108,9"
android:strokeWidth=
"0.8"
android:strokeColor=
"#33FFFFFF"
/>
<path
android:fillColor=
"#00000000"
android:pathData=
"M0,19L108,19"
android:strokeWidth=
"0.8"
android:strokeColor=
"#33FFFFFF"
/>
<path
android:fillColor=
"#00000000"
android:pathData=
"M0,29L108,29"
android:strokeWidth=
"0.8"
android:strokeColor=
"#33FFFFFF"
/>
<path
android:fillColor=
"#00000000"
android:pathData=
"M0,39L108,39"
android:strokeWidth=
"0.8"
android:strokeColor=
"#33FFFFFF"
/>
<path
android:fillColor=
"#00000000"
android:pathData=
"M0,49L108,49"
android:strokeWidth=
"0.8"
android:strokeColor=
"#33FFFFFF"
/>
<path
android:fillColor=
"#00000000"
android:pathData=
"M0,59L108,59"
android:strokeWidth=
"0.8"
android:strokeColor=
"#33FFFFFF"
/>
<path
android:fillColor=
"#00000000"
android:pathData=
"M0,69L108,69"
android:strokeWidth=
"0.8"
android:strokeColor=
"#33FFFFFF"
/>
<path
android:fillColor=
"#00000000"
android:pathData=
"M0,79L108,79"
android:strokeWidth=
"0.8"
android:strokeColor=
"#33FFFFFF"
/>
<path
android:fillColor=
"#00000000"
android:pathData=
"M0,89L108,89"
android:strokeWidth=
"0.8"
android:strokeColor=
"#33FFFFFF"
/>
<path
android:fillColor=
"#00000000"
android:pathData=
"M0,99L108,99"
android:strokeWidth=
"0.8"
android:strokeColor=
"#33FFFFFF"
/>
<path
android:fillColor=
"#00000000"
android:pathData=
"M19,29L89,29"
android:strokeWidth=
"0.8"
android:strokeColor=
"#33FFFFFF"
/>
<path
android:fillColor=
"#00000000"
android:pathData=
"M19,39L89,39"
android:strokeWidth=
"0.8"
android:strokeColor=
"#33FFFFFF"
/>
<path
android:fillColor=
"#00000000"
android:pathData=
"M19,49L89,49"
android:strokeWidth=
"0.8"
android:strokeColor=
"#33FFFFFF"
/>
<path
android:fillColor=
"#00000000"
android:pathData=
"M19,59L89,59"
android:strokeWidth=
"0.8"
android:strokeColor=
"#33FFFFFF"
/>
<path
android:fillColor=
"#00000000"
android:pathData=
"M19,69L89,69"
android:strokeWidth=
"0.8"
android:strokeColor=
"#33FFFFFF"
/>
<path
android:fillColor=
"#00000000"
android:pathData=
"M19,79L89,79"
android:strokeWidth=
"0.8"
android:strokeColor=
"#33FFFFFF"
/>
<path
android:fillColor=
"#00000000"
android:pathData=
"M29,19L29,89"
android:strokeWidth=
"0.8"
android:strokeColor=
"#33FFFFFF"
/>
<path
android:fillColor=
"#00000000"
android:pathData=
"M39,19L39,89"
android:strokeWidth=
"0.8"
android:strokeColor=
"#33FFFFFF"
/>
<path
android:fillColor=
"#00000000"
android:pathData=
"M49,19L49,89"
android:strokeWidth=
"0.8"
android:strokeColor=
"#33FFFFFF"
/>
<path
android:fillColor=
"#00000000"
android:pathData=
"M59,19L59,89"
android:strokeWidth=
"0.8"
android:strokeColor=
"#33FFFFFF"
/>
<path
android:fillColor=
"#00000000"
android:pathData=
"M69,19L69,89"
android:strokeWidth=
"0.8"
android:strokeColor=
"#33FFFFFF"
/>
<path
android:fillColor=
"#00000000"
android:pathData=
"M79,19L79,89"
android:strokeWidth=
"0.8"
android:strokeColor=
"#33FFFFFF"
/>
</vector>
dev/benchmarks/multiple_flutters/android/app/src/main/res/values-night/themes.xml
0 → 100644
View file @
e89b1513
<!-- Copyright 2014 The Flutter Authors. All rights reserved.
Use of this source code is governed by a BSD-style license that can be
found in the LICENSE file. -->
<resources
xmlns:tools=
"http://schemas.android.com/tools"
>
<!-- Base application theme. -->
<style
name=
"Theme.MultipleFlutters"
parent=
"Theme.MaterialComponents.DayNight.DarkActionBar"
>
<!-- Primary brand color. -->
<item
name=
"colorPrimary"
>
@color/purple_200
</item>
<item
name=
"colorPrimaryVariant"
>
@color/purple_700
</item>
<item
name=
"colorOnPrimary"
>
@color/black
</item>
<!-- Secondary brand color. -->
<item
name=
"colorSecondary"
>
@color/teal_200
</item>
<item
name=
"colorSecondaryVariant"
>
@color/teal_200
</item>
<item
name=
"colorOnSecondary"
>
@color/black
</item>
<!-- Status bar color. -->
<item
name=
"android:statusBarColor"
tools:targetApi=
"l"
>
?attr/colorPrimaryVariant
</item>
<!-- Customize your theme here. -->
</style>
</resources>
\ No newline at end of file
dev/benchmarks/multiple_flutters/android/app/src/main/res/values/colors.xml
0 → 100644
View file @
e89b1513
<!-- Copyright 2014 The Flutter Authors. All rights reserved.
Use of this source code is governed by a BSD-style license that can be
found in the LICENSE file. -->
<resources>
<color
name=
"purple_200"
>
#FFBB86FC
</color>
<color
name=
"purple_500"
>
#FF6200EE
</color>
<color
name=
"purple_700"
>
#FF3700B3
</color>
<color
name=
"teal_200"
>
#FF03DAC5
</color>
<color
name=
"teal_700"
>
#FF018786
</color>
<color
name=
"black"
>
#FF000000
</color>
<color
name=
"white"
>
#FFFFFFFF
</color>
</resources>
\ No newline at end of file
dev/benchmarks/multiple_flutters/android/app/src/main/res/values/strings.xml
0 → 100644
View file @
e89b1513
<!-- Copyright 2014 The Flutter Authors. All rights reserved.
Use of this source code is governed by a BSD-style license that can be
found in the LICENSE file. -->
<resources>
<string
name=
"app_name"
>
Multiple Flutters
</string>
</resources>
\ No newline at end of file
dev/benchmarks/multiple_flutters/android/app/src/main/res/values/themes.xml
0 → 100644
View file @
e89b1513
<!-- Copyright 2014 The Flutter Authors. All rights reserved.
Use of this source code is governed by a BSD-style license that can be
found in the LICENSE file. -->
<resources
xmlns:tools=
"http://schemas.android.com/tools"
>
<!-- Base application theme. -->
<style
name=
"Theme.MultipleFlutters"
parent=
"Theme.MaterialComponents.DayNight.DarkActionBar"
>
<!-- Primary brand color. -->
<item
name=
"colorPrimary"
>
@color/purple_500
</item>
<item
name=
"colorPrimaryVariant"
>
@color/purple_700
</item>
<item
name=
"colorOnPrimary"
>
@color/white
</item>
<!-- Secondary brand color. -->
<item
name=
"colorSecondary"
>
@color/teal_200
</item>
<item
name=
"colorSecondaryVariant"
>
@color/teal_700
</item>
<item
name=
"colorOnSecondary"
>
@color/black
</item>
<!-- Status bar color. -->
<item
name=
"android:statusBarColor"
tools:targetApi=
"l"
>
?attr/colorPrimaryVariant
</item>
<!-- Customize your theme here. -->
</style>
</resources>
\ No newline at end of file
dev/benchmarks/multiple_flutters/android/build.gradle
0 → 100644
View file @
e89b1513
// Copyright 2014 The Flutter Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
// Top-level build file where you can add configuration options common to all sub-projects/modules.
buildscript
{
ext
.
kotlin_version
=
"1.3.72"
repositories
{
google
()
jcenter
()
}
dependencies
{
classpath
"com.android.tools.build:gradle:4.1.2"
classpath
"org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}
allprojects
{
repositories
{
google
()
jcenter
()
}
}
task
clean
(
type:
Delete
)
{
delete
rootProject
.
buildDir
}
\ No newline at end of file
dev/benchmarks/multiple_flutters/android/gradle.properties
0 → 100644
View file @
e89b1513
# Project-wide Gradle settings.
# IDE (e.g. Android Studio) users:
# Gradle settings configured through the IDE *will override*
# any settings specified in this file.
# For more details on how to configure your build environment visit
# http://www.gradle.org/docs/current/userguide/build_environment.html
# Specifies the JVM arguments used for the daemon process.
# The setting is particularly useful for tweaking memory settings.
org.gradle.jvmargs
=
-Xmx2048m -Dfile.encoding=UTF-8
# When configured, Gradle will run in incubating parallel mode.
# This option should only be used with decoupled projects. More details, visit
# http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects
# org.gradle.parallel=true
# AndroidX package structure to make it clearer which packages are bundled with the
# Android operating system, and which are packaged with your app"s APK
# https://developer.android.com/topic/libraries/support-library/androidx-rn
android.useAndroidX
=
true
# Automatically convert third-party libraries to use AndroidX
android.enableJetifier
=
true
# Kotlin code style for this project: "official" or "obsolete":
kotlin.code.style
=
official
\ No newline at end of file
dev/benchmarks/multiple_flutters/android/gradle/wrapper/gradle-wrapper.properties
0 → 100644
View file @
e89b1513
#Wed Jan 27 11:54:04 PST 2021
distributionBase
=
GRADLE_USER_HOME
distributionPath
=
wrapper/dists
zipStoreBase
=
GRADLE_USER_HOME
zipStorePath
=
wrapper/dists
distributionUrl
=
https
\:
//services.gradle.org/distributions/gradle-6.5-all.zip
dev/benchmarks/multiple_flutters/android/settings.gradle
0 → 100644
View file @
e89b1513
// Copyright 2014 The Flutter Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
include
':app'
rootProject
.
name
=
"Multiple Flutters"
setBinding
(
new
Binding
([
gradle:
this
]))
// new
evaluate
(
new
File
(
// new
settingsDir
.
parentFile
,
// new
'./module/.android/include_flutter.groovy'
// new
))
\ No newline at end of file
dev/benchmarks/multiple_flutters/module/.gitignore
0 → 100644
View file @
e89b1513
.DS_Store
.dart_tool/
.packages
.pub/
.idea/
.vagrant/
.sconsign.dblite
.svn/
*.swp
profile
DerivedData/
.generated/
*.pbxuser
*.mode1v3
*.mode2v3
*.perspectivev3
!default.pbxuser
!default.mode1v3
!default.mode2v3
!default.perspectivev3
xcuserdata
*.moved-aside
*.pyc
*sync/
Icon?
.tags*
build/
.android/
.ios/
.flutter-plugins
.flutter-plugins-dependencies
# Symbolication related
app.*.symbols
# Obfuscation related
app.*.map.json
dev/benchmarks/multiple_flutters/module/.metadata
0 → 100644
View file @
e89b1513
# This file tracks properties of this Flutter project.
# Used by Flutter tool to assess capabilities and perform upgrades etc.
#
# This file should be version controlled and should not be manually edited.
version:
revision: 1d3f6971600f6e3fb144a30fab2b889e34af0c22
channel: master
project_type: module
dev/benchmarks/multiple_flutters/module/lib/main.dart
0 → 100644
View file @
e89b1513
// Copyright 2014 The Flutter Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
import
'package:flutter/material.dart'
;
void
main
(
)
=>
runApp
(
const
MyApp
(
Colors
.
blue
));
@pragma
(
'vm:entry-point'
)
void
topMain
(
)
=>
runApp
(
const
MyApp
(
Colors
.
green
));
@pragma
(
'vm:entry-point'
)
void
bottomMain
(
)
=>
runApp
(
const
MyApp
(
Colors
.
purple
));
class
MyApp
extends
StatelessWidget
{
const
MyApp
(
this
.
color
);
final
Color
color
;
@override
Widget
build
(
BuildContext
context
)
{
return
MaterialApp
(
title:
'Flutter Demo'
,
theme:
ThemeData
(
primarySwatch:
color
as
MaterialColor
,
),
home:
const
MyHomePage
(
title:
'Flutter Demo Home Page'
),
);
}
}
class
MyHomePage
extends
StatefulWidget
{
const
MyHomePage
({
Key
key
,
this
.
title
})
:
super
(
key:
key
);
final
String
title
;
@override
_MyHomePageState
createState
()
=>
_MyHomePageState
();
}
class
_MyHomePageState
extends
State
<
MyHomePage
>
{
@override
Widget
build
(
BuildContext
context
)
{
return
Scaffold
(
appBar:
AppBar
(
title:
Text
(
widget
.
title
),
),
body:
Center
(
child:
Column
(
mainAxisAlignment:
MainAxisAlignment
.
center
,
children:
<
Widget
>[
const
Text
(
'You have pushed the button this many times:'
,
),
Text
(
'0'
,
style:
Theme
.
of
(
context
).
textTheme
.
headline4
,
),
TextButton
(
onPressed:
()
{},
child:
const
Text
(
'Add'
),
),
TextButton
(
onPressed:
()
{},
child:
const
Text
(
'Next'
),
),
],
),
),
);
}
}
dev/benchmarks/multiple_flutters/module/pubspec.yaml
0 → 100644
View file @
e89b1513
name
:
multiple_flutters_module
description
:
A module that is embedded in the multiple_flutters benchmark test.
version
:
1.0.0+1
environment
:
sdk
:
'
>=2.8.1
<3.0.0'
dependencies
:
flutter
:
sdk
:
flutter
cupertino_icons
:
1.0.2
characters
:
1.1.0
# THIS LINE IS AUTOGENERATED - TO UPDATE USE "flutter update-packages --force-upgrade"
collection
:
1.15.0
# THIS LINE IS AUTOGENERATED - TO UPDATE USE "flutter update-packages --force-upgrade"
meta
:
1.3.0
# THIS LINE IS AUTOGENERATED - TO UPDATE USE "flutter update-packages --force-upgrade"
typed_data
:
1.3.0
# THIS LINE IS AUTOGENERATED - TO UPDATE USE "flutter update-packages --force-upgrade"
vector_math
:
2.1.0
# THIS LINE IS AUTOGENERATED - TO UPDATE USE "flutter update-packages --force-upgrade"
flutter
:
uses-material-design
:
true
module
:
androidX
:
true
androidPackage
:
com.example.multiple_flutters_module
iosBundleIdentifier
:
com.example.multipleFluttersModule
# PUBSPEC CHECKSUM: 6f0e
dev/devicelab/bin/tasks/flutter_engine_group_performance.dart
0 → 100644
View file @
e89b1513
// Copyright 2014 The Flutter Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
import
'dart:io'
;
import
'package:flutter_devicelab/framework/adb.dart'
;
import
'package:flutter_devicelab/framework/framework.dart'
;
import
'package:flutter_devicelab/framework/task_result.dart'
;
import
'package:flutter_devicelab/framework/utils.dart'
as
utils
;
import
'package:flutter_devicelab/tasks/perf_tests.dart'
show
ListStatistics
;
import
'package:path/path.dart'
as
path
;
const
String
_bundleName
=
'dev.flutter.multipleflutters'
;
const
String
_activityName
=
'MainActivity'
;
const
int
_numberOfIterations
=
10
;
Future
<
void
>
_withApkInstall
(
String
apkPath
,
String
bundleName
,
Function
(
AndroidDevice
)
body
)
async
{
final
DeviceDiscovery
devices
=
DeviceDiscovery
();
final
AndroidDevice
device
=
await
devices
.
workingDevice
as
AndroidDevice
;
await
device
.
unlock
();
await
device
.
adb
(<
String
>[
'install'
,
'-r'
,
apkPath
]);
try
{
await
body
(
device
);
}
finally
{
await
device
.
adb
(<
String
>[
'uninstall'
,
bundleName
]);
}
}
Future
<
TaskResult
>
_doTest
()
async
{
try
{
final
String
flutterDirectory
=
utils
.
flutterDirectory
.
path
;
final
String
multipleFluttersPath
=
path
.
join
(
flutterDirectory
,
'dev'
,
'benchmarks'
,
'multiple_flutters'
);
final
String
modulePath
=
path
.
join
(
multipleFluttersPath
,
'module'
);
final
String
androidPath
=
path
.
join
(
multipleFluttersPath
,
'android'
);
final
String
gradlew
=
Platform
.
isWindows
?
'gradlew.bat'
:
'gradlew'
;
final
String
gradlewExecutable
=
Platform
.
isWindows
?
'.
\\
$gradlew
'
:
'./
$gradlew
'
;
final
String
flutterPath
=
path
.
join
(
flutterDirectory
,
'bin'
,
'flutter'
);
await
utils
.
eval
(
flutterPath
,
<
String
>[
'pub'
,
'get'
],
workingDirectory:
modulePath
);
await
utils
.
eval
(
gradlewExecutable
,
<
String
>[
'assembleRelease'
],
workingDirectory:
androidPath
);
final
String
apkPath
=
path
.
join
(
multipleFluttersPath
,
'android'
,
'app'
,
'build'
,
'outputs'
,
'apk'
,
'release'
,
'app-release.apk'
);
TaskResult
result
;
await
_withApkInstall
(
apkPath
,
_bundleName
,
(
AndroidDevice
device
)
async
{
final
List
<
int
>
totalMemorySamples
=
<
int
>[];
for
(
int
i
=
0
;
i
<
_numberOfIterations
;
++
i
)
{
await
device
.
adb
(<
String
>[
'shell'
,
'am'
,
'start'
,
'-n'
,
'
$_bundleName
/
$_bundleName
.
$_activityName
'
]);
await
Future
<
void
>.
delayed
(
const
Duration
(
seconds:
10
));
final
Map
<
String
,
dynamic
>
memoryStats
=
await
device
.
getMemoryStats
(
_bundleName
);
final
int
totalMemory
=
memoryStats
[
'total_kb'
]
as
int
;
totalMemorySamples
.
add
(
totalMemory
);
await
device
.
stop
(
_bundleName
);
}
final
ListStatistics
totalMemoryStatistics
=
ListStatistics
(
totalMemorySamples
);
final
Map
<
String
,
dynamic
>
results
=
<
String
,
dynamic
>{
...
totalMemoryStatistics
.
asMap
(
'totalMemory'
)
};
result
=
TaskResult
.
success
(
results
,
benchmarkScoreKeys:
results
.
keys
.
toList
());
});
return
result
??
TaskResult
.
failure
(
'no results found'
);
}
catch
(
ex
)
{
return
TaskResult
.
failure
(
ex
.
toString
());
}
}
Future
<
void
>
main
()
async
{
task
(
_doTest
);
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment