Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(321)

Unified Diff: pkg/front_end/tool/fasta/standard_deviation.dart

Issue 2734863003: A/B fasta performance measurement harness (Closed)
Patch Set: merge Created 3 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: pkg/front_end/tool/fasta/standard_deviation.dart
diff --git a/pkg/front_end/tool/fasta/standard_deviation.dart b/pkg/front_end/tool/fasta/standard_deviation.dart
new file mode 100644
index 0000000000000000000000000000000000000000..aa6e7846666438496e64e13bd8f3d4d3c7a5ae00
--- /dev/null
+++ b/pkg/front_end/tool/fasta/standard_deviation.dart
@@ -0,0 +1,18 @@
+import 'dart:math';
ahe 2017/03/07 14:04:02 Missing copyright.
danrubel 2017/03/09 02:01:01 Fixed. https://codereview.chromium.org/2739963002/
+
+double average(List<double> elapsedTimes) {
+ return elapsedTimes.reduce((v, e) => v + e) / elapsedTimes.length;
+}
+
+double standardDeviation(double mean, List<double> elapsedTimes) {
+ double numerator = 0.0;
+ for (double elapseTime in elapsedTimes) {
+ numerator += (elapseTime - mean) * (elapseTime - mean);
+ }
+ double stdDev = sqrt(numerator / (elapsedTimes.length - 1));
+ return stdDev;
+}
+
+double standardDeviationOfTheMean(List<double> elapsedTimes, double stdDev) {
+ return stdDev / sqrt(elapsedTimes.length);
+}
« pkg/front_end/tool/fasta/compile.dart ('K') | « pkg/front_end/tool/fasta/compile.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698