11
11
re_rustc = re .compile ("rustc: .*/([\w\-_\.]*)" )
12
12
re_time_and_mem = re .compile ("( *)time: ([0-9\.]*); rss: ([0-9]*)MB\s*(.*)" )
13
13
re_time = re .compile ("( *)time: ([0-9\.]*)\s*(.*)" )
14
+ re_incremental_reuse = re .compile (" *incremental: re-using (\d+) out of (\d+) modules" )
15
+ re_incremental_dirty = re .compile (" *module .* is dirty because .* changed or was removed" )
14
16
15
17
re_loc = re .compile ("Lines of code: ([0-9]*)" )
16
18
re_pre_nc = re .compile ("Pre\-expansion node count: ([0-9]*)" )
@@ -103,29 +105,35 @@ def mk_times(in_file):
103
105
cur_times ['times' ].append ((label , float (time )))
104
106
cur_times ['rss' ].append ((label , int (0 )))
105
107
else :
106
- loc_match = re_loc .match (line )
107
- pre_nc_match = re_pre_nc .match (line )
108
- post_nc_match = re_post_nc .match (line )
109
- if loc_match :
110
- loc = loc_match .group (1 )
111
-
112
- elif pre_nc_match :
113
- pre_nc = pre_nc_match .group (1 )
114
-
115
- elif post_nc_match :
116
- post_nc = post_nc_match .group (1 )
117
-
118
- elif cur_times :
119
- if loc :
120
- cur_times ['loc' ] = int (loc )
121
- cur_times ['pre_nc' ] = int (pre_nc )
122
- cur_times ['post_nc' ] = int (post_nc )
123
- all_times .append (cur_times )
124
- cur_times = None
125
- last_file = None
126
- loc = None
127
- pre_nc = None
128
- post_nc = None
108
+ incremental_reuse_match = re_incremental_reuse .match (line )
109
+ incremental_dirty_match = re_incremental_dirty .match (line )
110
+ if incremental_reuse_match or incremental_dirty_match :
111
+ # FIXME -- might be useful to plot the reuse data somewhere
112
+ pass
113
+ else :
114
+ loc_match = re_loc .match (line )
115
+ pre_nc_match = re_pre_nc .match (line )
116
+ post_nc_match = re_post_nc .match (line )
117
+ if loc_match :
118
+ loc = loc_match .group (1 )
119
+
120
+ elif pre_nc_match :
121
+ pre_nc = pre_nc_match .group (1 )
122
+
123
+ elif post_nc_match :
124
+ post_nc = post_nc_match .group (1 )
125
+
126
+ elif cur_times :
127
+ if loc :
128
+ cur_times ['loc' ] = int (loc )
129
+ cur_times ['pre_nc' ] = int (pre_nc )
130
+ cur_times ['post_nc' ] = int (post_nc )
131
+ all_times .append (cur_times )
132
+ cur_times = None
133
+ last_file = None
134
+ loc = None
135
+ pre_nc = None
136
+ post_nc = None
129
137
130
138
131
139
rustc_match = re_rustc .match (line )
@@ -139,7 +147,8 @@ def merge_times(times):
139
147
for t in times :
140
148
t .sort (key = lambda t : t ['crate' ])
141
149
if len (t ) != len (times [0 ]):
142
- print "Inconsistent data"
150
+ print "Inconsistent data: len(t)=%s len(times[0])=%s" % (
151
+ len (t ), len (times [0 ]))
143
152
return
144
153
145
154
crates = []
0 commit comments