69
69
# filters {
70
70
border : 1px black;
71
71
border-style : dotted;
72
- margin : 16 px 0px ;
72
+ margin : 12 px 0px ;
73
73
border-radius : 10px ;
74
74
}
75
75
141
141
visibility : visible;
142
142
opacity : 1 ;
143
143
}
144
+
145
+ .description-box {
146
+ border : 1px solid;
147
+ display : flex;
148
+ }
149
+
150
+ .description-arrow {
151
+ display : flex;
152
+ flex-direction : column;
153
+ justify-content : center;
154
+ background : # 8dcc8d ;
155
+ padding : 5px ;
156
+ }
157
+
158
+ # not-continuous {
159
+ display : flex;
160
+ flex-direction : column;
161
+ justify-content : center;
162
+ text-align : center;
163
+ background : # cc3300 ;
164
+ border : 1px solid;
165
+ cursor : help;
166
+ }
144
167
</ style >
145
168
< script src ="https://cdn.jsdelivr.net/npm/vue@2/dist/vue.js "> </ script >
146
169
</ head >
152
175
</ div >
153
176
< br />
154
177
< div id ="app ">
155
- < h1 > Comparing < span id ="stat-header "> instructions:u</ span > between < span id ="before "> ???</ span > and < span
156
- id ="after "> ???</ span > </ h1 >
157
178
< fieldset id ="settings ">
158
179
< legend id ="search-toggle " class ="section-heading "> Do another comparison< span
159
180
id ="search-toggle-indicator "> </ span > </ legend >
@@ -179,6 +200,34 @@ <h1>Comparing <span id="stat-header">instructions:u</span> between <span id="bef
179
200
</ div >
180
201
< input id ="submit " type ="submit " value ="Submit " onclick ="submitSettings(); return false; ">
181
202
</ fieldset >
203
+ < h2 > Comparing < span id ="stat-header "> {{stat}}</ span > between < span id ="before "> {{before}}</ span > and
204
+ < span id ="after "> {{after}}</ span >
205
+ </ h2 >
206
+ < div v-if ="data " style ="margin: 12px 0; ">
207
+ < div style ="display: flex;justify-content: center; ">
208
+ < div class ="description-box ">
209
+ < div class ="description-arrow "> < a v-if ="data.prev " v-bind:href ="prevLink "> ←</ a > </ div >
210
+ < div style ="padding: 10px; ">
211
+ < a v-if ="data.a.pr " v-bind:href ="prLink(data.a.pr) "> #{{data.a.pr}}</ a >
212
+ < span v-if ="data.a.date "> {{formatDate(data.a.date)}}</ span >
213
+ (< a v-bind:href ="commitLink(data.a.commit) "> {{short(data.a)}}</ a > )
214
+ </ div >
215
+ </ div >
216
+ < div v-if ="notContinuous " id ="not-continuous " title ="WARNING! The commits are not continuous. "> ...
217
+ </ div >
218
+ < div class ="description-box ">
219
+ < div style ="padding: 10px; ">
220
+ < a v-if ="data.b.pr " v-bind:href ="prLink(data.b.pr) "> #{{data.b.pr}}</ a >
221
+ < span v-if ="data.b.date "> {{formatDate(data.b.date)}}</ span >
222
+ (< a v-bind:href ="commitLink(data.b.commit) "> {{short(data.b)}}</ a > )
223
+ </ div >
224
+ < div class ="description-arrow "> < a v-if ="data.next " v-bind:href ="nextLink "> →</ a > </ div >
225
+ </ div >
226
+ </ div >
227
+ < div style ="display: flex; justify-content: center; ">
228
+ < a v-bind:href ="compareLink "> 🔎 compare commits</ a >
229
+ </ div >
230
+ </ div >
182
231
< fieldset id ="filters ">
183
232
< legend id ="filters-toggle " class ="section-heading "> Filters< span id ="filters-toggle-indicator "> </ span >
184
233
</ legend >
@@ -244,40 +293,8 @@ <h1>Comparing <span id="stat-header">instructions:u</span> between <span id="bef
244
293
</ div >
245
294
</ div >
246
295
</ fieldset >
247
- < div id ="content " style ="margin-top: 15px ">
248
- < table v-if ="data " class ="compare " style ="font-size: medium !important; ">
249
- < thead >
250
- < tr >
251
- < td v-if ="notContinuous " colspan ="4 " style ="text-align:center; "> < b > Warning</ b > : The start and
252
- end
253
- are not adjacent!</ td >
254
- </ tr >
255
- < tr >
256
- < th >
257
- < a v-bind:href ="compareLink "> compare</ a >
258
- </ th >
259
- < th >
260
- < a v-if ="data.prev " v-bind:href ="prevLink "> ←</ a >
261
- {{formatDate(data.a.date)}}
262
- (< a > {{short(data.a)}}</ a > )
263
- </ th >
264
- < th >
265
- {{formatDate(data.b.date)}}
266
- (< a > {{short(data.b)}}</ a > )
267
- < a v-if ="data.next " v-bind:href ="nextLink "> →</ a >
268
- </ th >
269
- < th > % change</ th >
270
- </ tr >
271
- < tr >
272
- < th > </ th >
273
- < th style ="text-align: left; "> < a v-if ="data.a.pr "
274
- v-bind:href ="prLink(data.a.pr) "> #{{data.a.pr}}</ a >
275
- </ th >
276
- < th style ="text-align: left; "> < a v-if ="data.b.pr "
277
- v-bind:href ="prLink(data.b.pr) "> #{{data.b.pr}}</ a >
278
- </ th >
279
- </ tr >
280
- </ thead >
296
+ < div v-if ="data " id ="content " style ="margin-top: 15px ">
297
+ < table class ="compare " style ="width: 80%; margin: 0 auto; font-size: medium !important; ">
281
298
< tbody >
282
299
< template v-for ="bench in benches ">
283
300
< tr data-field-start ="true ">
@@ -287,7 +304,9 @@ <h1>Comparing <span id="stat-header">instructions:u</span> between <span id="bef
287
304
</ details >
288
305
</ th >
289
306
< td > min: < span v-bind:class ="percentClass(bench.minPct) "> {{bench.minPct}}%</ span > </ td >
290
- < td > max: < span v-bind:class ="percentClass(bench.maxPct) "> {{bench.maxPct}}%</ span > </ td >
307
+ < td > max: < span
308
+ v-bind:class ="percentClass(bench.maxPct) "> {{bench.maxPct}}%{{isDodgyBench(bench)
309
+ ? "?" : ""}}</ span > </ td >
291
310
< td > </ td >
292
311
</ tr >
293
312
< template v-for ="run in bench.variants ">
@@ -350,6 +369,16 @@ <h1>Comparing <span id="stat-header">instructions:u</span> between <span id="bef
350
369
< script src ="https://cdnjs.cloudflare.com/ajax/libs/msgpack-lite/0.1.26/msgpack.min.js "> </ script >
351
370
< script src ="shared.js "> </ script >
352
371
< script >
372
+ function findQueryParam ( name ) {
373
+ if ( ! window . location . search ) {
374
+ return null ;
375
+ }
376
+ let urlParams = window . location . search . substring ( 1 ) . split ( "&" ) . map ( x => x . split ( "=" ) ) ;
377
+ let pair = urlParams . find ( x => x [ 0 ] === name )
378
+ if ( pair ) {
379
+ return unescape ( pair [ 1 ] ) ;
380
+ }
381
+ }
353
382
let app = new Vue ( {
354
383
el : '#app' ,
355
384
data : {
@@ -471,6 +500,38 @@ <h1>Comparing <span id="stat-header">instructions:u</span> between <span id="bef
471
500
} ;
472
501
} ) . sort ( ( a , b ) => Math . abs ( b . percent ) - Math . abs ( a . percent ) ) ;
473
502
} ,
503
+ before ( ) {
504
+ if ( ! this . data ) {
505
+ const start = findQueryParam ( "start" ) ;
506
+ return start ? start . substring ( 0 , 7 ) : "???" ;
507
+ }
508
+ if ( this . data . a . pr ) {
509
+ return `#${ this . data . a . pr } ` ;
510
+ }
511
+ if ( this . data . a . date ) {
512
+ return this . formatDate ( this . data . a . date ) ;
513
+ }
514
+
515
+ return this . data . a . commit . substring ( 0 , 7 ) ;
516
+ } ,
517
+ after ( ) {
518
+ if ( ! this . data ) {
519
+ const end = findQueryParam ( "end" ) ;
520
+ return end ? end . substring ( 0 , 7 ) : "???" ;
521
+ }
522
+
523
+ if ( this . data . b . pr ) {
524
+ return `#${ this . data . b . pr } ` ;
525
+ }
526
+ if ( this . data . b . date ) {
527
+ return this . formatDate ( this . data . b . date ) ;
528
+ }
529
+
530
+ return this . data . b . commit . substring ( 0 , 7 ) ;
531
+ } ,
532
+ stat ( ) {
533
+ return findQueryParam ( "stat" ) || "instructions:u" ;
534
+ }
474
535
} ,
475
536
methods : {
476
537
short ( comparison ) {
@@ -499,6 +560,9 @@ <h1>Comparing <span id="stat-header">instructions:u</span> between <span id="bef
499
560
percentLink ( commit , baseCommit , bench , run ) {
500
561
return `/detailed-query.html?commit=${ commit } &base_commit=${ baseCommit } &benchmark=${ bench } &run_name=${ run } ` ;
501
562
} ,
563
+ commitLink ( commit ) {
564
+ return `https://github.com/rust-lang/rust/commit/${ commit } ` ;
565
+ } ,
502
566
formatDate ( date ) {
503
567
date = new Date ( date ) ;
504
568
function padStr ( i ) {
@@ -532,10 +596,10 @@ <h1>Comparing <span id="stat-header">instructions:u</span> between <span id="bef
532
596
let styles = document . getElementById ( id ) . style ;
533
597
let indicator = document . getElementById ( toggle ) ;
534
598
if ( styles . display != "none" ) {
535
- indicator . innerHTML = "⯈ "
599
+ indicator . innerHTML = " ▶ "
536
600
styles . display = "none" ;
537
601
} else {
538
- indicator . innerHTML = "▼"
602
+ indicator . innerHTML = " ▼"
539
603
styles . display = "block" ;
540
604
}
541
605
}
@@ -564,31 +628,10 @@ <h1>Comparing <span id="stat-header">instructions:u</span> between <span id="bef
564
628
stat : "instructions:u" ,
565
629
} , state ) ;
566
630
makeRequest ( "/get" , values ) . then ( function ( data ) {
567
- updateHeader ( data . a . commit , data . b . commit ) ;
568
631
app . data = data ;
569
632
} ) ;
570
633
}
571
634
572
- function updateHeader ( a , b , stat ) {
573
- let shorten = ( text ) => {
574
- return text . substring ( 0 , 7 ) ;
575
- }
576
- a && ( document . getElementById ( "before" ) . innerHTML = shorten ( a ) ) ;
577
- b && ( document . getElementById ( "after" ) . innerHTML = shorten ( b ) ) ;
578
- stat && ( document . getElementById ( "stat-header" ) . innerHTML = stat ) ;
579
- }
580
-
581
- function findQueryParam ( name ) {
582
- let urlParams = window . location . search . substring ( 1 ) . split ( "&" ) . map ( x => x . split ( "=" ) ) ;
583
- let pair = urlParams . find ( x => x [ 0 ] === name )
584
- if ( pair ) {
585
- return unescape ( pair [ 1 ] ) ;
586
- }
587
- }
588
- let start = findQueryParam ( "start" ) ;
589
- let end = findQueryParam ( "end" ) ;
590
- let stat = findQueryParam ( "stat" )
591
- updateHeader ( start , end , stat ) ;
592
635
593
636
function submitSettings ( ) {
594
637
let start = document . getElementById ( "start-bound" ) . value ;
0 commit comments