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
7c3f79f7
Unverified
Commit
7c3f79f7
authored
Feb 16, 2022
by
gaaclarke
Committed by
GitHub
Feb 16, 2022
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Added performance benchmarks to background platform channels for iOS. (#97991)
parent
b6232790
Changes
6
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
578 additions
and
65 deletions
+578
-65
project.pbxproj
..._channels_benchmarks/ios/Runner.xcodeproj/project.pbxproj
+488
-0
AppDelegate.h
...rks/platform_channels_benchmarks/ios/Runner/AppDelegate.h
+14
-0
AppDelegate.m
...rks/platform_channels_benchmarks/ios/Runner/AppDelegate.m
+36
-0
AppDelegate.swift
...platform_channels_benchmarks/ios/Runner/AppDelegate.swift
+0
-37
main.m
...benchmarks/platform_channels_benchmarks/ios/Runner/main.m
+15
-0
main.dart
dev/benchmarks/platform_channels_benchmarks/lib/main.dart
+25
-28
No files found.
dev/benchmarks/platform_channels_benchmarks/ios/Runner.xcodeproj/project.pbxproj
0 → 100644
View file @
7c3f79f7
This diff is collapsed.
Click to expand it.
dev/benchmarks/platform_channels_benchmarks/ios/Runner/AppDelegate.h
0 → 100644
View file @
7c3f79f7
// 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 <Foundation/Foundation.h>
#import <Flutter/Flutter.h>
NS_ASSUME_NONNULL_BEGIN
@interface
AppDelegate
:
FlutterAppDelegate
@end
NS_ASSUME_NONNULL_END
dev/benchmarks/platform_channels_benchmarks/ios/Runner/AppDelegate.m
0 → 100644
View file @
7c3f79f7
// 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 "AppDelegate.h"
@import
Flutter
;
#import "GeneratedPluginRegistrant.h"
@implementation
AppDelegate
-
(
BOOL
)
application
:(
UIApplication
*
)
application
didFinishLaunchingWithOptions
:(
NSDictionary
<
UIApplicationLaunchOptionsKey
,
id
>
*
)
launchOptions
{
[
GeneratedPluginRegistrant
registerWithRegistry
:
self
];
NSObject
<
FlutterPluginRegistrar
>*
registrar
=
[
self
registrarForPlugin
:
@"Echo"
];
FlutterBasicMessageChannel
*
reset
=
[[
FlutterBasicMessageChannel
alloc
]
initWithName
:
@"dev.flutter.echo.reset"
binaryMessenger
:
registrar
.
messenger
codec
:
FlutterStandardMessageCodec
.
sharedInstance
];
[
reset
setMessageHandler
:
^
(
id
_Nullable
message
,
FlutterReply
_Nonnull
callback
)
{
// noop
}];
FlutterBasicMessageChannel
*
basicStandard
=
[[
FlutterBasicMessageChannel
alloc
]
initWithName
:
@"dev.flutter.echo.basic.standard"
binaryMessenger
:
registrar
.
messenger
codec
:
FlutterStandardMessageCodec
.
sharedInstance
];
[
basicStandard
setMessageHandler
:
^
(
id
_Nullable
message
,
FlutterReply
_Nonnull
callback
)
{
callback
(
message
);
}];
FlutterBasicMessageChannel
*
basicBinary
=
[[
FlutterBasicMessageChannel
alloc
]
initWithName
:
@"dev.flutter.echo.basic.binary"
binaryMessenger
:
registrar
.
messenger
codec
:
FlutterBinaryCodec
.
sharedInstance
];
[
basicBinary
setMessageHandler
:
^
(
id
_Nullable
message
,
FlutterReply
_Nonnull
callback
)
{
callback
(
message
);
}];
NSObject
<
FlutterTaskQueue
>*
taskQueue
=
[
registrar
.
messenger
makeBackgroundTaskQueue
];
FlutterBasicMessageChannel
*
background
=
[[
FlutterBasicMessageChannel
alloc
]
initWithName
:
@"dev.flutter.echo.background.standard"
binaryMessenger
:
registrar
.
messenger
codec
:
FlutterStandardMessageCodec
.
sharedInstance
taskQueue
:
taskQueue
];
[
background
setMessageHandler
:
^
(
id
_Nullable
message
,
FlutterReply
_Nonnull
callback
)
{
callback
(
message
);
}];
return
YES
;
}
@end
dev/benchmarks/platform_channels_benchmarks/ios/Runner/AppDelegate.swift
deleted
100644 → 0
View file @
b6232790
// 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
Flutter
import
UIKit
@UIApplicationMain
@objc
class
AppDelegate
:
FlutterAppDelegate
{
override
func
application
(
_
application
:
UIApplication
,
didFinishLaunchingWithOptions
launchOptions
:
[
UIApplication
.
LaunchOptionsKey
:
Any
]?
)
->
Bool
{
GeneratedPluginRegistrant
.
register
(
with
:
self
)
let
registrar
=
self
.
registrar
(
forPlugin
:
"Echo"
)
!
let
reset
=
FlutterBasicMessageChannel
(
name
:
"dev.flutter.echo.reset"
,
binaryMessenger
:
registrar
.
messenger
())
reset
.
setMessageHandler
{
(
input
,
reply
)
in
// noop
}
let
basicStandard
=
FlutterBasicMessageChannel
(
name
:
"dev.flutter.echo.basic.standard"
,
binaryMessenger
:
registrar
.
messenger
(),
codec
:
FlutterStandardMessageCodec
.
sharedInstance
())
basicStandard
.
setMessageHandler
{
(
input
,
reply
)
in
reply
(
input
)
}
let
basicBinary
=
FlutterBasicMessageChannel
(
name
:
"dev.flutter.echo.basic.binary"
,
binaryMessenger
:
registrar
.
messenger
(),
codec
:
FlutterBinaryCodec
())
basicBinary
.
setMessageHandler
{
(
input
,
reply
)
in
reply
(
input
)
}
return
super
.
application
(
application
,
didFinishLaunchingWithOptions
:
launchOptions
)
}
}
dev/benchmarks/platform_channels_benchmarks/ios/Runner/main.m
0 → 100644
View file @
7c3f79f7
//
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
<
UIKit
/
UIKit
.
h
>
#import
"AppDelegate.h"
int
main
(
int
argc
,
char
*
argv
[])
{
NSString
*
appDelegateClassName
;
@
autoreleasepool
{
//
Setup
code
that
might
create
autoreleased
objects
goes
here
.
appDelegateClassName
=
NSStringFromClass
([
AppDelegate
class
])
;
}
return
UIApplicationMain
(
argc
,
argv
,
nil
,
appDelegateClassName
)
;
}
dev/benchmarks/platform_channels_benchmarks/lib/main.dart
View file @
7c3f79f7
...
@@ -3,7 +3,6 @@
...
@@ -3,7 +3,6 @@
// found in the LICENSE file.
// found in the LICENSE file.
import
'dart:async'
;
import
'dart:async'
;
import
'dart:io'
show
Platform
;
import
'dart:math'
as
math
;
import
'dart:math'
as
math
;
import
'dart:typed_data'
;
import
'dart:typed_data'
;
...
@@ -161,6 +160,7 @@ Future<void> _runTest({
...
@@ -161,6 +160,7 @@ Future<void> _runTest({
required
String
name
,
required
String
name
,
required
int
numMessages
,
required
int
numMessages
,
})
async
{
})
async
{
print
(
'running
$name
'
);
resetChannel
.
send
(
true
);
resetChannel
.
send
(
true
);
// Prime test.
// Prime test.
await
test
(
1
);
await
test
(
1
);
...
@@ -247,33 +247,30 @@ Future<void> _runTests() async {
...
@@ -247,33 +247,30 @@ Future<void> _runTests() async {
name:
'platform_channel_basic_standard_2host_small_parallel_3'
,
name:
'platform_channel_basic_standard_2host_small_parallel_3'
,
numMessages:
numMessages
,
numMessages:
numMessages
,
);
);
if
(
Platform
.
isAndroid
)
{
// Background platform channels aren't yet implemented for iOS.
// Background platform channels aren't yet implemented for iOS.
const
BasicMessageChannel
<
Object
?>
backgroundStandard
=
const
BasicMessageChannel
<
Object
?>
backgroundStandard
=
BasicMessageChannel
<
Object
?>(
BasicMessageChannel
<
Object
?>(
'dev.flutter.echo.background.standard'
,
'dev.flutter.echo.background.standard'
,
StandardMessageCodec
(),
StandardMessageCodec
(),
);
);
await
_runTest
(
await
_runTest
(
test:
(
int
x
)
=>
_runBasicStandardSmall
(
backgroundStandard
,
x
),
test:
(
int
x
)
=>
_runBasicStandardSmall
(
backgroundStandard
,
x
),
resetChannel:
resetChannel
,
resetChannel:
resetChannel
,
printer:
printer
,
printer:
printer
,
description:
description:
'BasicMessageChannel/StandardMessageCodec/Flutter->Host (background)/Small'
,
'BasicMessageChannel/StandardMessageCodec/Flutter->Host (background)/Small'
,
name:
'platform_channel_basic_standard_2hostbackground_small'
,
name:
'platform_channel_basic_standard_2hostbackground_small'
,
numMessages:
numMessages
,
numMessages:
numMessages
,
);
);
await
_runTest
(
await
_runTest
(
test:
(
int
x
)
=>
_runBasicStandardParallel
(
backgroundStandard
,
x
,
1234
,
3
),
test:
(
int
x
)
=>
resetChannel:
resetChannel
,
_runBasicStandardParallel
(
backgroundStandard
,
x
,
1234
,
3
),
printer:
printer
,
resetChannel:
resetChannel
,
description:
printer:
printer
,
'BasicMessageChannel/StandardMessageCodec/Flutter->Host (background)/SmallParallel3'
,
description:
name:
'platform_channel_basic_standard_2hostbackground_small_parallel_3'
,
'BasicMessageChannel/StandardMessageCodec/Flutter->Host (background)/SmallParallel3'
,
numMessages:
numMessages
,
name:
'platform_channel_basic_standard_2hostbackground_small_parallel_3'
,
);
numMessages:
numMessages
,
);
}
printer
.
printToStdout
();
printer
.
printToStdout
();
}
}
...
...
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