150
150
opacity : 1 ;
151
151
}
152
152
</ style >
153
+ < script src ="https://cdn.jsdelivr.net/npm/vue@2/dist/vue.js "> </ script >
153
154
</ head >
154
155
155
156
< body class ="container " style ="max-width:800px ">
@@ -236,7 +237,24 @@ <h1>Comparing <span id="stat-header">instructions:u</span> between <span id="bef
236
237
</ div >
237
238
</ div >
238
239
</ fieldset >
239
- < div id ="content " style ="display: none; margin-top: 15px "> </ div >
240
+ < div id ="content " style ="margin-top: 15px ">
241
+ < div v-if ="data ">
242
+ < div v-if ="notContinuous "> Warning: The start and end are not adjacent!</ div >
243
+ < a v-bind:href ="compareLink "> compare</ a >
244
+ < a v-if ="data.prev " v-bind:href ="prevLink "> ←</ a >
245
+ < div >
246
+ < span > {{data.a.date}}</ span >
247
+ < span > ({{short(data.a)}})</ span >
248
+ </ div >
249
+ < div >
250
+ < span > {{data.b.date}}</ span >
251
+ < span > ({{short(data.b)}})</ span >
252
+ </ div >
253
+ </ div >
254
+ < a v-if ="data.next " v-bind:href ="nextLink "> →</ a >
255
+ < a v-if ="data.a.pr " v-bind:href ="prLink(data.a.pr) "> #{{data.a.pr}}</ a >
256
+ < a v-if ="data.b.pr " v-bind:href ="prLink(data.b.pr) "> #{{data.b.pr}}</ a >
257
+ </ div >
240
258
< br >
241
259
< div id ="as-of "> </ div >
242
260
< a href ="https://github.com/rust-lang-nursery/rustc-perf ">
@@ -248,6 +266,34 @@ <h1>Comparing <span id="stat-header">instructions:u</span> between <span id="bef
248
266
< script src ="https://cdnjs.cloudflare.com/ajax/libs/msgpack-lite/0.1.26/msgpack.min.js "> </ script >
249
267
< script src ="shared.js "> </ script >
250
268
< script >
269
+ let app = new Vue ( {
270
+ el : '#content' ,
271
+ data : {
272
+ data : null
273
+ } ,
274
+ computed : {
275
+ notContinuous : function ( ) {
276
+ return ! this . data . is_contiguous ;
277
+ } ,
278
+ prevLink : function ( ) {
279
+ return `/compare.html?start=${ this . data . prev } &end=${ this . data . a . commit } ` ;
280
+ } ,
281
+ nextLink : function ( ) {
282
+ return `/compare.html?start=${ this . data . b . commit } &end=${ this . data . next } ` ;
283
+ } ,
284
+ compareLink : function ( ) {
285
+ return `https://github.com/rust-lang/rust/compare/${ this . data . a . commit } ...${ this . data . b . commit } ` ;
286
+ }
287
+ } ,
288
+ methods : {
289
+ short : function ( comparison ) {
290
+ return shortCommit ( comparison . commit ) ;
291
+ } ,
292
+ prLink : function ( pr ) {
293
+ return `https://github.com/rust-lang/rust/pull/${ pr } ` ;
294
+ }
295
+ }
296
+ } )
251
297
function toggleFilters ( id , toggle ) {
252
298
let styles = document . getElementById ( id ) . style ;
253
299
let indicator = document . getElementById ( toggle ) ;
@@ -275,7 +321,7 @@ <h1>Comparing <span id="stat-header">instructions:u</span> between <span id="bef
275
321
return ( i < 10 ) ? "0" + i : "" + i ;
276
322
}
277
323
278
- return `${ date . getUTCFullYear ( ) } -${ pad_str ( date . getUTCMonth ( ) + 1 ) } -${ pad_str ( date . getUTCDate ( ) ) } ` ;
324
+ return `${ date . getUTCFullYear ( ) } -${ pad_str ( date . getUTCMonth ( ) + 1 ) } -${ pad_str ( date . getUTCDate ( ) ) } ` ;
279
325
}
280
326
281
327
function unique ( arr ) {
@@ -293,7 +339,7 @@ <h1>Comparing <span id="stat-header">instructions:u</span> between <span id="bef
293
339
txt = datum . toLocaleString ( 'en-US' , { minimumFractionDigits : 3 , maximumFractionDigits : 3 } ) ;
294
340
}
295
341
if ( selfProfileAvailable ) {
296
- html += `<a href= "/detailed-query.html?commit=${ sha } &benchmark=${ bench } &run_name=${ run } "> ${ txt } </a> ` ;
342
+ html += `< a href = "/detailed-query.html?commit=${ sha } &benchmark=${ bench } &run_name=${ run } " > ${ txt } </a > ` ;
297
343
} else {
298
344
html += txt ;
299
345
}
@@ -327,16 +373,21 @@ <h1>Comparing <span id="stat-header">instructions:u</span> between <span id="bef
327
373
let title = "" ;
328
374
let marker = "" ;
329
375
if ( dodgy ) {
330
- title = `title= "${ dodgy } "` ;
376
+ title = `title = "${ dodgy } "` ;
331
377
marker = dodgy_marker ;
332
378
}
333
- return `<span ${ klass } ${ title } >${ pct . toFixed ( 1 ) } %${ marker } </span> ` ;
379
+ return `< span ${ klass } ${ title } > ${ pct . toFixed ( 1 ) } % ${ marker } </span > ` ;
334
380
} else {
335
381
return "<span>-</span>"
336
382
}
337
383
}
338
384
385
+ function shortCommit ( commit ) {
386
+ return commit . substring ( 0 , 8 ) ;
387
+ }
388
+
339
389
function populate_data ( data ) {
390
+ app . data = data ;
340
391
{
341
392
let filter = document . querySelector ( "#filter" ) . value ;
342
393
let test_names = unique ( [
@@ -380,13 +431,13 @@ <h1>Comparing <span id="stat-header">instructions:u</span> between <span id="bef
380
431
381
432
let html = "" ;
382
433
383
- html += `<table class="compare" style= "font-size: medium !important;"> ` ;
434
+ html += `< table class="compare" style = "font-size: medium !important;" > ` ;
384
435
html += "<thead>" ;
385
436
386
437
if ( ! data . is_contiguous ) {
387
- html += `<tr> <td colspan=4 style= "text-align:center;"> ` ;
388
- html += `<b> Warning</b>: The start and end are not adjacent!` ;
389
- html += `</td></tr> ` ;
438
+ html += `< tr > <td colspan=4 style = "text-align:center;" > ` ;
439
+ html += `< b > Warning</b >: The start and end are not adjacent!` ;
440
+ html += `</td ></tr > ` ;
390
441
}
391
442
392
443
// Heading: the two dates, and the time and rss percent changes.
@@ -402,23 +453,23 @@ <h1>Comparing <span id="stat-header">instructions:u</span> between <span id="bef
402
453
let params = new URLSearchParams ( window . location . search ) ;
403
454
params . set ( "end" , params . get ( "start" ) ) ;
404
455
params . set ( "start" , data . prev ) ;
405
- prev_link = `<a href= "/compare.html?${ params . toString ( ) } ">& larr;</a> ` ;
456
+ prev_link = `< a href = "/compare.html?${ params . toString ( ) } " >& larr;</a > ` ;
406
457
}
407
458
let next_link = "" ;
408
459
if ( data . next ) {
409
460
let params = new URLSearchParams ( window . location . search ) ;
410
461
params . set ( "start" , params . get ( "end" ) ) ;
411
462
params . set ( "end" , data . next ) ;
412
- next_link = ` <a href= "/compare.html?${ params . toString ( ) } ">& rarr;</a> ` ;
463
+ next_link = ` < a href = "/compare.html?${ params . toString ( ) } " >& rarr;</a > ` ;
413
464
}
414
465
html += "<th>"
415
466
+ prev_link + ""
416
467
+ print_date ( new Date ( data . a . date ) )
417
468
+ ` (<a href="https://github.com/rust-lang/rust/commit/${ data . a . commit } "
418
- >${ data . a . commit . substring ( 0 , 8 ) } </a>)` + "</th>" ;
469
+ >${ data . a . commit . substring ( 0 , 8 ) } </a>)` + "</th>" ;
419
470
html += "<th>" + print_date ( new Date ( data . b . date ) )
420
471
+ ` (<a href="https://github.com/rust-lang/rust/commit/${ data . b . commit } "
421
- >${ data . b . commit . substring ( 0 , 8 ) } </a>)`
472
+ >${ data . b . commit . substring ( 0 , 8 ) } </a>)`
422
473
+ next_link
423
474
+ "</th>" ;
424
475
@@ -427,10 +478,12 @@ <h1>Comparing <span id="stat-header">instructions:u</span> between <span id="bef
427
478
428
479
html += "<tr>" ;
429
480
html += "<th></th>" ;
430
- html += `<th style="text-align:left;">${ data . a . pr ? `<a
431
- href="https://github.com/rust-lang/rust/pull/${ data . a . pr } ">#${ data . a . pr } </a>` : "" } </th>`;
432
- html += `<th style="text-align:left;">${ data . b . pr ? `<a
433
- href="https://github.com/rust-lang/rust/pull/${ data . b . pr } ">#${ data . b . pr } </a>` : "" } </th>`;
481
+ html += `< th style = "text-align:left;" > ${ data . a . pr ? `<a
482
+ href="https://github.com/rust-lang/rust/pull/${ data . a . pr } ">#${ data . a . pr } </a>` : ""
483
+ } </th > `;
484
+ html += `< th style = "text-align:left;" > ${ data . b . pr ? `<a
485
+ href="https://github.com/rust-lang/rust/pull/${ data . b . pr } ">#${ data . b . pr } </a>` : ""
486
+ } </th > `;
434
487
html += "</tr>" ;
435
488
436
489
html += "</thead>" ;
@@ -564,10 +617,10 @@ <h1>Comparing <span id="stat-header">instructions:u</span> between <span id="bef
564
617
}
565
618
566
619
if ( variance . type == "HighlyVariable" ) {
567
- return `This measurement varies a lot. Do not trust it!`
620
+ return `This measurement varies a lot.Do not trust it!`
568
621
}
569
622
if ( variance . type == "Noisy" ) {
570
- return `This measurement is noisy. Do not trust it!`
623
+ return `This measurement is noisy.Do not trust it!`
571
624
}
572
625
return "" ;
573
626
}
@@ -586,32 +639,32 @@ <h1>Comparing <span id="stat-header">instructions:u</span> between <span id="bef
586
639
is_first_bootstrap = false ;
587
640
588
641
html += "<tr data-field-start=true>" ;
589
- html += `<th style= "width: ${ max_name_width / 2 } em;" data-js- name=Total> ` + truncate_name ( "total" ) + "</th>" ;
642
+ html += `< th style = "width: ${ max_name_width / 2 } em;" data - js - name=Total > ` + truncate_name ( "total" ) + "</th>" ;
590
643
let sum = ( acc , value ) => acc + value ;
591
644
let a_total = fields . filter ( f => f . is_bootstrap ) . map ( f => f . fields [ 0 ] . datum_a ) . reduce ( sum ) ;
592
645
let b_total = fields . filter ( f => f . is_bootstrap ) . map ( f => f . fields [ 0 ] . datum_b ) . reduce ( sum ) ;
593
646
html += add_datum_fields ( a_total , data . a . commit , "Total" , "" , false ) ;
594
647
html += add_datum_fields ( b_total , data . b . commit , "Total" , "" , false ) ;
595
648
let pct = add_percent ( percent_chg ( a_total , b_total ) , dodgy , "??" ) ;
596
- html += `<td> ${ pct } </td> ` ;
649
+ html += `< td > ${ pct } </td > ` ;
597
650
html += "</tr>" ;
598
651
}
599
652
html += "<tr data-field-start=true>" ;
600
- html += `<th style= "width: ${ max_name_width / 2 } em;" data-js- name=${ field . name } >` + truncate_name ( field . name ) + "</th>" ;
653
+ html += `< th style = "width: ${ max_name_width / 2 } em;" data - js - name=${ field . name } > ` + truncate_name ( field . name ) + "</th>" ;
601
654
let entry = field . fields [ 0 ] ;
602
655
html += add_datum_fields ( entry . datum_a , data . a . commit ,
603
656
field . name , entry . casename , false ) ;
604
657
html += add_datum_fields ( entry . datum_b , data . b . commit ,
605
658
field . name , entry . casename , false ) ;
606
659
let pct = add_percent ( entry . percent , dodgy , "??" ) ;
607
- html += `<td> ${ pct } </td> ` ;
660
+ html += `< td > ${ pct } </td > ` ;
608
661
html += "</tr>" ;
609
662
} else {
610
663
html += "<tr><td> </td></tr>" ;
611
664
html += "<tr data-field-start=true>" ;
612
- html += `<th style= "width: ${ max_name_width / 2 } em;" data-js- name=${ field . name } >` +
613
- `<details class=toggle- table> <summary>` +
614
- truncate_name ( field . name ) + "</summary></details></th> " ;
665
+ html += `< th style = "width: ${ max_name_width / 2 } em;" data - js - name=${ field . name } > ` +
666
+ `< details class=toggle - table > <summary>` +
667
+ truncate_name ( field . name ) + "</summary></details ></th > " ;
615
668
html += "<td> avg: " + add_percent ( field . avg_pct , dodgy , "?" ) + "</td>" ;
616
669
html += "<td text-align=center> min: " + add_percent ( field . min_pct , dodgy , "?" ) +
617
670
"</td>" ;
@@ -640,8 +693,8 @@ <h1>Comparing <span id="stat-header">instructions:u</span> between <span id="bef
640
693
641
694
html += "</table>" ;
642
695
643
- document . getElementById ( "content" ) . innerHTML = html ;
644
- document . getElementById ( "content" ) . style . display = "block" ;
696
+ // document.getElementById("content").innerHTML = html;
697
+ // document.getElementById("content").style.display = "block";
645
698
for ( let element of document . querySelectorAll ( ".toggle-table" ) ) {
646
699
let name = element . parentElement . getAttribute ( "data-js-name" ) ;
647
700
let in_body = [ ] ;
0 commit comments