First create a hello.dart
file with the following content.
void main(List<String> args) {
print('Hello, World!');
}
Next we precompile this file using PRODUCT
AOT compiler (equivalent of running flutter build aot --release
).
void main() { | |
final count = 1000000; | |
final names = ['good', 'bad', 'whatever']; | |
final tests = [_test1, _test2, _test3]; | |
final sw = Stopwatch(); | |
var repeat = 10; | |
sw.start(); | |
while (repeat-- > 0) { | |
for (var i = 0; i < tests.length; i++) { | |
final name = names[i]; |
library writer; | |
import 'dart:typed_data'; | |
/// Writer wraps a fixed size Uint8List and writes values into it using | |
/// big-endian byte order. | |
class Writer { | |
/// Output buffer. | |
final Uint8List out; |
+------------------------------------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------+--------------+ | |
| Library | Method | Diff (Bytes) | | |
+------------------------------------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------+--------------+ | |
| package:gallery/codeviewer/code_segments.dart | CodeSegments.transformationsDemo |
+------------------------------------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------+--------------+ | |
| Library | Method | Diff (Bytes) | | |
+------------------------------------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------+--------------+ | |
| package:gallery/codeviewer/code_segments.dart | CodeSegments.transformationsDemo |
diff --git a/lib/recase.dart b/lib/recase.dart | |
index da14cec..42a1251 100644 | |
--- a/lib/recase.dart | |
+++ b/lib/recase.dart | |
@@ -1,44 +1,94 @@ | |
+import 'dart:typed_data'; | |
+ | |
/// An instance of text to be re-cased. | |
class ReCase { | |
- final RegExp _upperAlphaRegex = new RegExp(r'[A-Z]'); |
First create a hello.dart
file with the following content.
void main(List<String> args) {
print('Hello, World!');
}
Next we precompile this file using PRODUCT
AOT compiler (equivalent of running flutter build aot --release
).
// Copyright (c) 2020, the Dart project authors. | |
// | |
// Redistribution and use in source and binary forms, with or without | |
// modification, are permitted provided that the following conditions are | |
// met: | |
// * Redistributions of source code must retain the above copyright | |
// notice, this list of conditions and the following disclaimer. | |
// * Redistributions in binary form must reproduce the above | |
// copyright notice, this list of conditions and the following | |
// disclaimer in the documentation and/or other materials provided |
void sayHello() => print('Hello, World!'); |
diff --git a/SuperPi_flutter/lib/pi_calculator.dart b/SuperPi_flutter/lib/pi_calculator.dart | |
index 39faf59..b519f6a 100644 | |
--- a/SuperPi_flutter/lib/pi_calculator.dart | |
+++ b/SuperPi_flutter/lib/pi_calculator.dart | |
@@ -30,7 +30,7 @@ class PiCalculator { | |
double yk1 ; | |
for (int i = 0; i < k; i++) { | |
yk1 = (1 - math.pow((1 - yk * yk * yk * yk),(0.25)))/(1 + math.pow((1 - yk * yk * yk * yk),(0.25))); | |
- ak1 = ak * math.pow((1 + yk1), 4) - math.pow(2, 2 * i + 3) * yk1 * (1 + yk1 + yk1 * yk1); | |
+ ak1 = ak * math.pow((1 + yk1), 4.0) - math.pow(2.0, (2 * i + 3) + 0.0) * yk1 * (1 + yk1 + yk1 * yk1); |
#include <stdio.h> // for fprintf() | |
#include <fcntl.h> | |
#include <unistd.h> // for close(), read() | |
#include <sys/epoll.h> // for epoll_create1(), epoll_ctl(), struct epoll_event | |
#include <string.h> // for strncmp | |
#include <errno.h> | |
const int kMaxEvents = 5; | |
const int kReadSize = 5; |