@@ -29,7 +29,10 @@ <h2>Comparison</h2>
2929 {% if show_historical %}
3030 < div id ="historical ">
3131 < h3 > How fast is {{ default_exe.project }}?</ h3 >
32- < div id ="baseline-comparison-plot " style ="position:relative;height:400px; "> </ div >
32+ < iframe src ="{% url 'embed-comparison' %} "
33+ title ="{{ default_exe.project }} ({{ default_exe }}) vs {{ baseline }} benchmark comparison "
34+ style ="border:0;width:100%;height:400px "
35+ loading ="lazy "> </ iframe >
3336 < p class ="plot-caption "> Plot 1: The above plot represents {{ default_exe.project }} ({{ default_exe }}) benchmark times normalized to {{ baseline }}. Smaller is better.</ p >
3437 < p > It depends greatly on the type of task being performed. The geometric average of all benchmarks is < span id ="geomean "> </ span > or < strong id ="geofaster "> </ strong > times < em > faster</ em > than {{ baseline }}</ p >
3538
@@ -68,15 +71,15 @@ <h3>How has PyPy performance evolved over time?</h3>
6871
6972 function renderplot ( data ) {
7073 if ( data === null || data . length === 0 ) {
71- $ ( "#baseline-comparison -plot" ) . html ( getLoadText ( 'Error retrieving data' , 0 ) ) ;
74+ $ ( "#historical -plot" ) . html ( getLoadText ( 'Error retrieving data' , 0 ) ) ;
7275 return ;
7376 }
7477 if ( typeof data === 'string' || data instanceof String ) {
75- $ ( "#baseline-comparison -plot" ) . html ( getLoadText ( 'Error retrieving data ' + data , 0 ) ) ;
78+ $ ( "#historical -plot" ) . html ( getLoadText ( 'Error retrieving data ' + data , 0 ) ) ;
7679 return ;
7780 }
7881
79- var benchmarks = [ ] , latestValues = [ ] , baselineValues = [ ] ;
82+ var latestValues = [ ] ;
8083 var trunk_geomean = 1 ;
8184 var tagged_data = [ ] ;
8285 for ( var i in data [ 'tagged_revs' ] ) { tagged_data [ i ] = [ ] ; }
@@ -90,45 +93,17 @@ <h3>How has PyPy performance evolved over time?</h3>
9093 tagged_data [ i ] . push ( data [ 'results' ] [ benchname ] [ rev ] / data [ 'results' ] [ benchname ] [ data [ 'baseline' ] ] ) ;
9194 }
9295 if ( ! add_to_tagged_data ) { continue ; }
93- benchmarks . push ( benchname ) ;
9496 var rel = data [ 'results' ] [ benchname ] [ 'latest' ] / data [ 'results' ] [ benchname ] [ data [ 'baseline' ] ] ;
9597 latestValues . push ( rel ) ;
96- baselineValues . push ( 1.0 ) ;
9798 if ( rel > 0 && ! isNaN ( rel ) ) { trunk_geomean *= rel ; }
9899 }
99100
100101 trunk_geomean = Math . pow ( trunk_geomean , 1 / latestValues . length ) ;
101102 $ ( '#geomean' ) . html ( trunk_geomean . toFixed ( 2 ) ) ;
102103 $ ( '#geofaster' ) . html ( ( 1 / trunk_geomean ) . toFixed ( 1 ) ) ;
103104
104- // Plot 1: per-benchmark normalized comparison
105- var wrap1 = document . getElementById ( 'baseline-comparison-plot' ) ;
106- var canvas1 = document . createElement ( 'canvas' ) ;
107- wrap1 . appendChild ( canvas1 ) ;
108- new Chart ( canvas1 , {
109- type : 'bar' ,
110- data : {
111- labels : benchmarks ,
112- datasets : [
113- { label : 'latest {{ default_exe }}' , data : latestValues , backgroundColor : '#4e79a7' } ,
114- { label : data [ 'baseline' ] , data : baselineValues , type : 'line' ,
115- borderColor : '#f28e2b' , backgroundColor : 'transparent' ,
116- pointRadius : 0 , borderWidth : 2 , fill : false }
117- ]
118- } ,
119- options : {
120- animation : false ,
121- responsive : true ,
122- maintainAspectRatio : false ,
123- plugins : {
124- tooltip : { position : 'cursor' }
125- } ,
126- scales : {
127- x : { ticks : { maxRotation : 70 , minRotation : 70 , autoSkip : false , font : { size : 11 } } } ,
128- y : { min : 0 , max : 2.0 , ticks : { callback : function ( v ) { return v . toFixed ( 2 ) ; } } }
129- }
130- }
131- } ) ;
105+ // Plot 1 (per-benchmark normalized comparison) is rendered by the
106+ // embed_comparison page shown in the iframe above.
132107
133108 // Plot 2: geomean speedup over tagged revisions
134109 var geomeans = [ 1.0 ] ;
0 commit comments