Repository navigation
FlutterBench results model and placeholder data - #14168
ericwindmill wants to merge 3 commits into
Conversation
There was a problem hiding this comment.
Code Review
This pull request introduces dataset tasks, benchmark results, and Dart models/utilities for parsing and formatting FlutterBench metrics, along with comprehensive unit tests. The review feedback highlights two key improvements in bench_format.dart: first, updating formatScoreWithSd to fall back to displaying just the mean when the standard deviation is null; second, using !delta.isNegative instead of delta >= 0.0 in formatDelta to prevent double-sign formatting issues with negative zero (-0.0). Additionally, corresponding test cases should be added to verify these behaviors.
| String formatScoreWithSd(double? mean, double? sd) { | ||
| if (mean == null || sd == null) return missingValue; | ||
| return '${(mean * 100).toStringAsFixed(1)}% ± ' | ||
| '${(sd * 100).toStringAsFixed(1)}%'; | ||
| } |
There was a problem hiding this comment.
If sd is null but mean is not null, formatScoreWithSd currently returns missingValue (—), which hides the average score entirely. We can improve this by returning just the formatted mean when standard deviation is unavailable.
String formatScoreWithSd(double? mean, double? sd) {
if (mean == null) return missingValue;
if (sd == null) return formatPercent(mean);
return '${(mean * 100).toStringAsFixed(1)}% ± '
'${(sd * 100).toStringAsFixed(1)}%';
}References
- Report an issue only if the change introduces or worsens it, it's of medium severity or higher, and you can state its concrete consequence. (link)
| String formatDelta(double? delta, {String suffix = '%', int decimals = 1}) { | ||
| if (delta == null) return missingValue; | ||
| final prefix = delta >= 0.0 ? '+' : ''; | ||
| return '$prefix${delta.toStringAsFixed(decimals)}$suffix'; | ||
| } |
There was a problem hiding this comment.
Using delta >= 0.0 can lead to formatting bugs with negative zero (-0.0), where -0.0 >= 0.0 evaluates to true in Dart, resulting in a prefix of + and a formatted string of +-0.0%. Using !delta.isNegative correctly handles negative zero and avoids double-sign formatting issues.
String formatDelta(double? delta, {String suffix = '%', int decimals = 1}) {
if (delta == null) return missingValue;
final prefix = !delta.isNegative ? '+' : '';
return '$prefix${delta.toStringAsFixed(decimals)}$suffix';
}References
- Report an issue only if the change introduces or worsens it, it's of medium severity or higher, and you can state its concrete consequence. (link)
|
Staged preview of the updated flutter.dev site (updated for commit 1f3a60c): https://flutter-dev-230821--www-pr14168-fb-1-model-8qia1g3n.web.app |
There was a problem hiding this comment.
This is purposefully nulled/zeroed out results.
There was a problem hiding this comment.
This is fake/partial data. It will change to real data when the time comes.
Description of what this PR is changing or adding, and why:
First PR in the FlutterBench leaderboard stack for flutter.dev. This PR doesn't make any visual changes.
This PR adds some dummy JSON files needed to build, and their Dart models
Presubmit checklist
of 80 characters or fewer.