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

Side by Side Diff: Tools/Scripts/compare-timing-files

Issue 20652002: Fix trailing whitespace in scripts and misc. files (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Don't change literal diff. Created 7 years, 5 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « Tools/Scripts/clean-header-guards ('k') | Tools/Scripts/configure-github-as-upstream » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 #!/usr/bin/perl 1 #!/usr/bin/perl
2 2
3 # Copyright (C) 2006 Apple Computer, Inc. All rights reserved. 3 # Copyright (C) 2006 Apple Computer, Inc. All rights reserved.
4 # 4 #
5 # Redistribution and use in source and binary forms, with or without 5 # Redistribution and use in source and binary forms, with or without
6 # modification, are permitted provided that the following conditions 6 # modification, are permitted provided that the following conditions
7 # are met: 7 # are met:
8 # 8 #
9 # 1. Redistributions of source code must retain the above copyright 9 # 1. Redistributions of source code must retain the above copyright
10 # notice, this list of conditions and the following disclaimer. 10 # notice, this list of conditions and the following disclaimer.
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after
61 61
62 my $gainOrLoss = $newAverage <= $oldAverage ? "GAIN" : "LOSS"; 62 my $gainOrLoss = $newAverage <= $oldAverage ? "GAIN" : "LOSS";
63 my $difference = abs($newAverage - $oldAverage); 63 my $difference = abs($newAverage - $oldAverage);
64 my $differencePercent = $difference / $oldAverage * 100; 64 my $differencePercent = $difference / $oldAverage * 100;
65 printf("\nperformance %s of %.2f%% (%.1f / %.1f)\n", $gainOrLoss, $differencePer cent, $difference, $oldAverage); 65 printf("\nperformance %s of %.2f%% (%.1f / %.1f)\n", $gainOrLoss, $differencePer cent, $difference, $oldAverage);
66 print "\n"; 66 print "\n";
67 67
68 sub parseResults 68 sub parseResults
69 { 69 {
70 my ($file) = @_; 70 my ($file) = @_;
71 71
72 open(FILE, $file) or die "Couldn't open file: $file"; 72 open(FILE, $file) or die "Couldn't open file: $file";
73 my @results = <FILE>; 73 my @results = <FILE>;
74 close(FILE); 74 close(FILE);
75 75
76 @results = sort(@results); 76 @results = sort(@results);
77 my $total = 0; 77 my $total = 0;
78 for (my $i = 0; $i < $count; $i++) { 78 for (my $i = 0; $i < $count; $i++) {
79 $results[$i] =~ s/\D*//; # cut out non-digits 79 $results[$i] =~ s/\D*//; # cut out non-digits
80 $total += $results[$i]; 80 $total += $results[$i];
81 } 81 }
82 my $average = $total / $count; 82 my $average = $total / $count;
83 my $range = $results[$count - 1] - $results[0]; 83 my $range = $results[$count - 1] - $results[0];
84 my $rangePercent = $range / $results[$count - 1] * 100; 84 my $rangePercent = $range / $results[$count - 1] * 100;
85 85
86 return ($average, $range, $rangePercent); 86 return ($average, $range, $rangePercent);
87 } 87 }
88 88
OLDNEW
« no previous file with comments | « Tools/Scripts/clean-header-guards ('k') | Tools/Scripts/configure-github-as-upstream » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698