-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
15 changed files
with
1,175 additions
and
401 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
# Isolate parsing performance | ||
|
||
**Parsing in isolate took 2400-2500 microseconds.** | ||
|
||
**Parsing on main thread took 20-60 microseconds.** | ||
|
||
Parsing JSON on an isolate allows you to perform the operation in the background without blocking the main thread, which can be useful for large JSON files or when you need to perform other operations while parsing. |
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
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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
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,56 @@ | ||
import 'dart:async'; | ||
|
||
import 'package:dash_kit_network/dash_kit_network.dart'; | ||
|
||
// ignore: prefer-match-file-name | ||
abstract class IsolateManagerInterface { | ||
Future<void> start(); | ||
|
||
void stop(); | ||
|
||
Future<FutureOr<T>> send<T>( | ||
Response<dynamic> response, | ||
FutureOr<T> Function(Response<dynamic>) mapper, | ||
); | ||
} | ||
|
||
class Task<T> { | ||
const Task( | ||
this.id, | ||
this.response, | ||
this.mapper, | ||
); | ||
|
||
final String id; | ||
final Response<dynamic> response; | ||
final T Function(Response<dynamic>) mapper; | ||
|
||
@override | ||
String toString() { | ||
return 'Task{id: $id, response: $response, mapper: $mapper}'; | ||
} | ||
} | ||
|
||
class Result<T> { | ||
const Result({ | ||
required this.id, | ||
this.result, | ||
this.error, | ||
}); | ||
|
||
final String id; | ||
final T? result; | ||
final dynamic error; | ||
|
||
@override | ||
String toString() { | ||
return 'Result{id: $id, result: $result, error: $error}'; | ||
} | ||
} | ||
|
||
enum IsolateStatus { | ||
created, | ||
initializing, | ||
initialized, | ||
stopped, | ||
} |
Oops, something went wrong.