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
f68911ee
Unverified
Commit
f68911ee
authored
Oct 29, 2020
by
Jonah Williams
Committed by
GitHub
Oct 29, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[framework] increase threshold for compute to 50Kb (#69307)
parent
31c96b5d
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
3 deletions
+5
-3
asset_bundle.dart
packages/flutter/lib/src/services/asset_bundle.dart
+5
-3
No files found.
packages/flutter/lib/src/services/asset_bundle.dart
View file @
f68911ee
...
...
@@ -71,11 +71,13 @@ abstract class AssetBundle {
// that the null-handling logic is dead code).
if
(
data
==
null
)
throw
FlutterError
(
'Unable to load asset:
$key
'
);
// ignore: dead_code
if
(
data
.
lengthInBytes
<
10
*
1024
)
{
// 10KB takes about 3ms to parse on a Pixel 2 XL
.
// See: https://github.com/dart-lang/sdk/issues/31954
// 50 KB of data should take 2-3 ms to parse on a Moto G4, and about 400 μs
// on a Pixel 4
.
if
(
data
.
lengthInBytes
<
50
*
1024
)
{
return
utf8
.
decode
(
data
.
buffer
.
asUint8List
());
}
// For strings larger than 50 KB, run the computation in an isolate to
// avoid causing main thread jank.
return
compute
(
_utf8decode
,
data
,
debugLabel:
'UTF8 decode for "
$key
"'
);
}
...
...
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