Technology | Time taken for tests (sec) | Complete requests | Failed requests | Requests per second (mean) | Time per request (ms) | Time per request (concurrent ms) | Transfer rate (Kbytes/sec) |
---|---|---|---|---|---|---|---|
CivetWeb | 40.100 | 100,000 | 129 | 2493.77 | 400.999 | 0.401 | 136.21 |
Dart + Shelf | 12.758 | 100,000 | 0 | 7837.96 | 127.584 | 0.128 | 2005.42 |
Node.js | 10.457 | 100,000 | 0 | 9562.88 | 104.571 | 0.105 | 1055.28 |
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
/* | |
* Long Polling example | |
* https://gist.github.com/PlugFox/51038cb6f587332f6e803790a7d991e5 | |
* https://dartpad.dev?id=51038cb6f587332f6e803790a7d991e5 | |
* Matiunin Mikhail <plugfox@gmail.com>, 29 October 2023 | |
*/ | |
// ignore_for_file: avoid_print | |
import 'dart:async'; |
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
/* | |
* Polling example | |
* https://gist.github.com/PlugFox/b6e5bbbbfe79157c8229f1ba4808fbe9 | |
* https://dartpad.dev?id=b6e5bbbbfe79157c8229f1ba4808fbe9 | |
* Matiunin Mikhail <plugfox@gmail.com>, 29 October 2023 | |
*/ | |
// ignore_for_file: avoid_print | |
import 'dart:async'; |
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
/* | |
* Пример обмена данными между клиентом и сервером по протоколу TCP/IP | |
* https://gist.github.com/PlugFox/9cc2adb1d8df24fae2164e95dba6a911 | |
* https://dartpad.dev?id=9cc2adb1d8df24fae2164e95dba6a911 | |
* Matiunin Mikhail <plugfox@gmail.com>, 29 October 2023 | |
*/ | |
// ignore_for_file: avoid_print, lines_longer_than_80_chars | |
import 'dart:async'; |
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
import 'dart:async'; | |
import 'package:flutter/foundation.dart'; | |
import 'package:flutter/material.dart'; | |
import 'package:flutter/services.dart'; | |
/// {@template text_measure} | |
/// TextMeasure widget. | |
/// {@endtemplate} | |
class TextMeasure extends StatefulWidget { |
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
import 'dart:isolate'; | |
void main() async { | |
final toMainIsolate = ReceivePort(); | |
final stream = toMainIsolate; | |
void fn(ITargetAction action) => action.handleAction(); | |
final worker = Worker<ITargetAction>( | |
port: toMainIsolate.sendPort, |
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
import 'dart:convert'; | |
import 'package:crypto/crypto.dart'; | |
import 'package:meta/meta.dart'; | |
/// {@template jwt} | |
/// A JWT token consists of three parts: the header, | |
/// the payload, and the signature or encryption data. | |
/// The first two elements are JSON objects of a specific structure. | |
/// The third element is calculated based on the first two |
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
import 'dart:convert'; | |
void main() { | |
final jsonRaw = '{"items": [1, 2, 3]}'; | |
final json = jsonDecode(jsonRaw) as Map<String, Object?>; // good | |
try { | |
//final items = (json['items'] as List<Object?>).cast<int>().toList(); // good | |
final items = json['items'] as List<int>; // bad | |
print(items); | |
} on Object catch (err) { |
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
import 'package:flutter/widgets.dart'; | |
import 'sizer.dart'; | |
class AdaptiveWidget extends StatefulWidget { | |
const AdaptiveWidget({ | |
required this.compactChild, | |
required this.extendedChild, | |
this.alignment = Alignment.center, | |
super.key, | |
}); |
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
/// Dependencies | |
abstract interface class Dependencies { | |
/// The state from the closest instance of this class. | |
factory Dependencies.of(BuildContext context) => InheritedDependencies.of(context); | |
/// App metadata | |
abstract final AppMetadata appMetadata; | |
/// Database | |
abstract final Database database; |