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
d030296a
Unverified
Commit
d030296a
authored
Feb 20, 2020
by
Dan Field
Committed by
GitHub
Feb 20, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Reland test (#50987)
parent
2ce51aa2
Changes
8
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
136 additions
and
1 deletion
+136
-1
common.dart
dev/benchmarks/macrobenchmarks/lib/common.dart
+1
-0
main.dart
dev/benchmarks/macrobenchmarks/lib/main.dart
+10
-1
animated_placeholder.dart
...chmarks/macrobenchmarks/lib/src/animated_placeholder.dart
+68
-0
animated_placeholder_perf.dart
...acrobenchmarks/test_driver/animated_placeholder_perf.dart
+11
-0
animated_placeholder_perf_test.dart
...enchmarks/test_driver/animated_placeholder_perf_test.dart
+16
-0
animated_placeholder_perf.dart
dev/devicelab/bin/tasks/animated_placeholder_perf.dart
+12
-0
perf_tests.dart
dev/devicelab/lib/tasks/perf_tests.dart
+9
-0
manifest.yaml
dev/devicelab/manifest.yaml
+9
-0
No files found.
dev/benchmarks/macrobenchmarks/lib/common.dart
View file @
d030296a
...
...
@@ -10,3 +10,4 @@ const String kSimpleAnimationRouteName = '/simple_animation';
const
String
kPictureCacheRouteName
=
'/picture_cache'
;
const
String
kLargeImagesRouteName
=
'/large_images'
;
const
String
kTextRouteName
=
'/text'
;
const
String
kAnimatedPlaceholderRouteName
=
'/animated_placeholder'
;
dev/benchmarks/macrobenchmarks/lib/main.dart
View file @
d030296a
...
...
@@ -7,6 +7,7 @@ import 'package:macrobenchmarks/src/large_images.dart';
import
'package:macrobenchmarks/src/picture_cache.dart'
;
import
'common.dart'
;
import
'src/animated_placeholder.dart'
;
import
'src/backdrop_filter.dart'
;
import
'src/cubic_bezier.dart'
;
import
'src/cull_opacity.dart'
;
...
...
@@ -14,7 +15,7 @@ import 'src/post_backdrop_filter.dart';
import
'src/simple_animation.dart'
;
import
'src/text.dart'
;
const
String
kMacrobenchmarks
=
'Macrobenchmarks'
;
const
String
kMacrobenchmarks
=
'Macrobenchmarks'
;
void
main
(
)
=>
runApp
(
const
MacrobenchmarksApp
());
...
...
@@ -36,6 +37,7 @@ class MacrobenchmarksApp extends StatelessWidget {
kPictureCacheRouteName:
(
BuildContext
context
)
=>
PictureCachePage
(),
kLargeImagesRouteName:
(
BuildContext
context
)
=>
LargeImagesPage
(),
kTextRouteName:
(
BuildContext
context
)
=>
TextPage
(),
kAnimatedPlaceholderRouteName:
(
BuildContext
context
)
=>
AnimatedPlaceholderPage
(),
},
);
}
...
...
@@ -106,6 +108,13 @@ class HomePage extends StatelessWidget {
Navigator
.
pushNamed
(
context
,
kTextRouteName
);
},
),
RaisedButton
(
key:
const
Key
(
kAnimatedPlaceholderRouteName
),
child:
const
Text
(
'Animated Placeholder'
),
onPressed:
()
{
Navigator
.
pushNamed
(
context
,
kAnimatedPlaceholderRouteName
);
},
),
],
),
);
...
...
dev/benchmarks/macrobenchmarks/lib/src/animated_placeholder.dart
0 → 100644
View file @
d030296a
// 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:async'
;
import
'dart:convert'
;
import
'dart:ui'
as
ui
show
Codec
;
import
'package:flutter/foundation.dart'
;
import
'package:flutter/material.dart'
;
/// An animated GIF image with 3 1x1 pixel frames (a red, green, and blue
/// frames). The GIF animates forever, and each frame has a 100ms delay.
const
String
kAnimatedGif
=
'R0lGODlhAQABAKEDAAAA//8AAAD/AP///yH/C05FVFNDQVBFMi'
'4wAwEAAAAh+QQACgD/ACwAAAAAAQABAAACAkwBACH5BAAKAP8A'
'LAAAAAABAAEAAAICVAEAIfkEAAoA/wAsAAAAAAEAAQAAAgJEAQ'
'A7'
;
/// A 50x50 blue square png
const
String
kBlueSquare
=
'iVBORw0KGgoAAAANSUhEUgAAADIAAAAyCAYAAAAeP4ixAAAASEl'
'EQVR42u3PMQ0AMAgAsGFjL/4tYQU08JLWQSN/9TsgRERERERERE'
'REREREREREREREREREREREREREREREREREREREREQ2BgNuaUcSj'
'uqqAAAAAElFTkSuQmCC'
;
/// A 10x10 grid of animated looping placeholder gifts that fade into a
/// blue square.
class
AnimatedPlaceholderPage
extends
StatelessWidget
{
@override
Widget
build
(
BuildContext
context
)
{
return
GridView
.
builder
(
itemCount:
100
,
gridDelegate:
const
SliverGridDelegateWithFixedCrossAxisCount
(
crossAxisCount:
10
),
itemBuilder:
(
BuildContext
context
,
int
index
)
{
return
FadeInImage
(
placeholder:
DelayedBase64Image
(
Duration
.
zero
,
kAnimatedGif
),
image:
DelayedBase64Image
(
Duration
(
milliseconds:
100
*
index
),
kBlueSquare
),
);
},
);
}
}
int
_key
=
0
;
/// An image provider that is always unique from other DelayedBase64Images and
/// simulates a delay in loading.
class
DelayedBase64Image
extends
ImageProvider
<
int
>
{
const
DelayedBase64Image
(
this
.
delay
,
this
.
data
);
final
String
data
;
final
Duration
delay
;
@override
Future
<
int
>
obtainKey
(
ImageConfiguration
configuration
)
{
return
SynchronousFuture
<
int
>(
_key
++);
}
@override
ImageStreamCompleter
load
(
int
key
,
DecoderCallback
decode
)
{
return
MultiFrameImageStreamCompleter
(
codec:
Future
<
ui
.
Codec
>.
delayed
(
delay
,
()
=>
decode
(
base64
.
decode
(
data
)),
),
scale:
1.0
,
);
}
}
dev/benchmarks/macrobenchmarks/test_driver/animated_placeholder_perf.dart
0 → 100644
View file @
d030296a
// 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_driver/driver_extension.dart'
;
import
'package:macrobenchmarks/main.dart'
as
app
;
void
main
(
)
{
enableFlutterDriverExtension
();
app
.
main
();
}
dev/benchmarks/macrobenchmarks/test_driver/animated_placeholder_perf_test.dart
0 → 100644
View file @
d030296a
// 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:macrobenchmarks/common.dart'
;
import
'util.dart'
;
void
main
(
)
{
macroPerfTest
(
'animated_placeholder_perf'
,
kAnimatedPlaceholderRouteName
,
pageDelay:
const
Duration
(
seconds:
1
),
duration:
const
Duration
(
seconds:
15
),
);
}
dev/devicelab/bin/tasks/animated_placeholder_perf.dart
0 → 100644
View file @
d030296a
// 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_devicelab/framework/adb.dart'
;
import
'package:flutter_devicelab/framework/framework.dart'
;
import
'package:flutter_devicelab/tasks/perf_tests.dart'
;
Future
<
void
>
main
()
async
{
deviceOperatingSystem
=
DeviceOperatingSystem
.
android
;
await
task
(
createAnimatedPlaceholderPerfTest
());
}
dev/devicelab/lib/tasks/perf_tests.dart
View file @
d030296a
...
...
@@ -81,6 +81,15 @@ TaskFunction createSimpleAnimationPerfTest({bool needsMeasureCpuGpu = false}) {
).
run
;
}
TaskFunction
createAnimatedPlaceholderPerfTest
(
{
bool
needsMeasureCpuGpu
=
false
})
{
return
PerfTest
(
'
${flutterDirectory.path}
/dev/benchmarks/macrobenchmarks'
,
'test_driver/animated_placeholder_perf.dart'
,
'animated_placeholder_perf'
,
needsMeasureCpuGPu:
needsMeasureCpuGpu
,
).
run
;
}
TaskFunction
createPictureCachePerfTest
(
)
{
return
PerfTest
(
'
${flutterDirectory.path}
/dev/benchmarks/macrobenchmarks'
,
...
...
dev/devicelab/manifest.yaml
View file @
d030296a
...
...
@@ -700,6 +700,15 @@ tasks:
stage
:
devicelab
required_agent_capabilities
:
[
"
mac/android"
]
animated_placeholder_perf
:
description
:
>
Measures frame build and rasterizer times, as well as frame build counts
for a grid of images that uses FadeInImage with an animated gif as the
placeholder.
stage
:
devicelab
required_agent_capabilities
:
[
"
linux/android"
]
flaky
:
true
analyzer_benchmark
:
description
:
>
Measures the speed of Dart analyzer.
...
...
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