Skip to content

Commit 5e2ef99

Browse files
authored
Fix compiler perf infrastructure after new memory statistics (#28026)
2 parents 409beb9 + 5d65913 commit 5e2ef99

File tree

2 files changed

+14
-22
lines changed

2 files changed

+14
-22
lines changed
Lines changed: 3 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,15 @@
11
perfkeys: numSuccessfulCompiles
22
graphkeys: Num of Successful Compiles
33
graphtitle: Number of Successful Compiles
4-
graphName: numberOfSuccessfulCompiles
5-
6-
7-
perfkeys: numPasses
8-
graphkeys: Num Passes
9-
graphtitle: Number of Passes
10-
graphName: numberOfPasses
11-
4+
graphname: numberOfSuccessfulCompiles
125

136
perfkeys: totalTimeCompiling, elapsedTestTime
147
graphkeys: Time Compiling, Time Testing
158
graphtitle: Time Spent Compiling vs Testing
169
ylabel: Time (hours)
17-
graphName: timeCompilingVsTesting
18-
10+
graphname: timeCompilingVsTesting
1911

2012
perfkeys: percentTimeCompiling
2113
graphkeys: Percent of Time Compiling
2214
graphtitle: Percent of Testing Spent Compiling
23-
graphName: percentTimeCompiling
15+
graphname: percentTimeCompiling

util/test/combineCompPerfData

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -80,15 +80,15 @@ def main():
8080
lines = firstFile.readlines()
8181
# get the perfkeys out of the first line, first line starts with a '#'
8282
perfKeysString = lines[0]
83-
perfKeys = [ l.strip() for l in perfKeysString.replace('#', '').split('\t') ]
84-
# There are as many passes are there are keys (-1 for the date)
85-
numPasses = len(perfKeys) - 1
83+
perfKeys = [ l.strip() for l in perfKeysString.replace('#', '').split('\t')[1:] ]
84+
# There are as many passes are there are time keys
85+
numPasses = len([ k for k in perfKeys if "time" in k ])
8686
# grab the date
8787
date = lines[1].split('\t')[0]
8888
# create two lists to keep track of the combined results. One for the
8989
# tests in the release/examples directory and one for all tests
90-
allCombinedValues = [ float(0) for i in range(numPasses) ]
91-
releaseExampleCombinedValues = [ float(0) for i in range(numPasses) ]
90+
allCombinedValues = [ float(0) for i in range(len(perfKeys)) ]
91+
releaseExampleCombinedValues = [ float(0) for i in range(len(perfKeys)) ]
9292
firstFile.close()
9393

9494
except IOError:
@@ -109,24 +109,24 @@ def main():
109109
# read in the actual values and remove the date
110110
perfValues = [ l.strip() for l in lines[1].split('\t')[1:] ]
111111
# check that we had the right number of passes
112-
if len(perfValues) != numPasses:
112+
if len(perfValues) != len(perfKeys):
113113
sys.stderr.write('[ERROR: num passes is not the same for all files: %s]\n' %(tempDatDir + datFile))
114114
continue
115115
# for each value add it to the running total and maybe the release
116116
# example running total if it was in that dir
117117
for valueIndex in range(len(perfValues)):
118-
value = float(perfValues[valueIndex])
119-
allCombinedValues[valueIndex] += value;
120-
if isReleaseExample:
121-
releaseExampleCombinedValues[valueIndex] += value;
118+
value = float(perfValues[valueIndex])
119+
allCombinedValues[valueIndex] += value
120+
if isReleaseExample:
121+
releaseExampleCombinedValues[valueIndex] += value
122122
f.close()
123123

124124
except IOError:
125125
sys.stderr.write('[ERROR: Could not open dat file: %s]\n'%(datFile))
126126
return -1
127127

128128
# get the total time compiling, which is the last "pass"
129-
totalTimeCompiling = allCombinedValues[numPasses - 1]
129+
totalTimeCompiling = next(allCombinedValues[i] for i in range(len(allCombinedValues)) if perfKeys[i] == 'total time :')
130130

131131
# compute the average for each value and truncate to two decimal places
132132
allCombinedValues = [ '%1.2f'%(i/numCompiles) for i in allCombinedValues ]

0 commit comments

Comments
 (0)