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

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

Issue 2731703003: A/B fasta performance measurement harness (Closed)
Patch Set: Created 3 years, 10 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..b0efaa9366dc62b11c728de4490715e1b39a5063
--- /dev/null
+++ b/pkg/front_end/tool/fasta/standard_deviation.dart
@@ -0,0 +1,18 @@
+import 'dart:math';
+
+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);
Paul Berry 2017/03/03 18:08:53 This should be: `stdDev = sqrt(numerator / (elaps
danrubel 2017/03/03 22:46:56 Done.
+ return stdDev;
+}
+
+double standardDeviationOfTheMean(List<double> elapsedTimes, double stdDev) {
+ return stdDev / sqrt(elapsedTimes.length);
Paul Berry 2017/03/03 18:08:53 This one is correct.
+}
« pkg/front_end/tool/fasta/abcompile.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