@@ -68,8 +68,8 @@ <h3 id="title"></h3>
68
68
}
69
69
70
70
function fmt_delta ( from , to ) {
71
- let delta = from - to ;
72
- let pct = ( from - to ) / to * 100 ;
71
+ let delta = to - from ;
72
+ let pct = ( to - from ) / from * 100 ;
73
73
if ( from == to ) {
74
74
pct = 0 ;
75
75
}
@@ -87,7 +87,7 @@ <h3 id="title"></h3>
87
87
if ( Math . abs ( delta ) <= 0.05 ) {
88
88
classes = "neutral" ;
89
89
}
90
- return `<span class="${ classes } " title="${ from . toFixed ( 3 ) } - ${ to . toFixed ( 3 ) } ≈ ${ delta . toFixed ( 3 ) } ">${ pct . toFixed ( 1 ) } %</span>` ;
90
+ return `<span class="${ classes } " title="${ from . toFixed ( 3 ) } to ${ to . toFixed ( 3 ) } ≈ ${ delta . toFixed ( 3 ) } ">${ pct . toFixed ( 1 ) } %</span>` ;
91
91
} else {
92
92
return `<span title="error" style="color: orange;">-</span>` ;
93
93
}
@@ -141,12 +141,12 @@ <h3 id="title"></h3>
141
141
let table = document . getElementById ( "primary-table" ) ;
142
142
let idx = 0 ;
143
143
for ( let element of data . profile . query_data ) {
144
- let a = to_object ( element ) ;
145
- let b = null ;
144
+ let cur = to_object ( element ) ;
145
+ let prev = null ;
146
146
if ( data . base_profile ) {
147
- for ( let b_el of data . base_profile [ 0 ] ) {
148
- if ( to_object ( b_el ) . label == a . label ) {
149
- b = to_object ( b_el ) ;
147
+ for ( let prev_el of data . base_profile [ 0 ] ) {
148
+ if ( to_object ( prev_el ) . label == cur . label ) {
149
+ prev = to_object ( prev_el ) ;
150
150
break ;
151
151
}
152
152
}
@@ -160,31 +160,31 @@ <h3 id="title"></h3>
160
160
}
161
161
row . appendChild ( td ) ;
162
162
}
163
- td ( row , a . label ) ;
164
- td ( row , to_seconds ( a . self_time ) . toFixed ( 3 ) ) ;
165
- if ( b ) {
166
- td ( row , fmt_delta ( to_seconds ( b . self_time ) , to_seconds ( a . self_time ) ) , true ) ;
163
+ td ( row , cur . label ) ;
164
+ td ( row , to_seconds ( cur . self_time ) . toFixed ( 3 ) ) ;
165
+ if ( prev ) {
166
+ td ( row , fmt_delta ( to_seconds ( prev . self_time ) , to_seconds ( cur . self_time ) ) , true ) ;
167
167
} else {
168
168
td ( row , "-" , true ) ;
169
169
}
170
- td ( row , a . invocation_count ) ;
171
- if ( b ) {
172
- td ( row , fmt_delta ( b . invocation_count , a . invocation_count ) , true ) ;
170
+ td ( row , cur . invocation_count ) ;
171
+ if ( prev ) {
172
+ td ( row , fmt_delta ( prev . invocation_count , cur . invocation_count ) , true ) ;
173
173
} else {
174
174
td ( row , "-" , true ) ;
175
175
}
176
- td ( row , a . cache_misses ) ;
177
- if ( b ) {
178
- td ( row , fmt_delta ( b . cache_misses , a . cache_misses ) , true ) ;
176
+ td ( row , cur . cache_misses ) ;
177
+ if ( prev ) {
178
+ td ( row , fmt_delta ( prev . cache_misses , cur . cache_misses ) , true ) ;
179
179
} else {
180
180
td ( row , "-" , true ) ;
181
181
}
182
- td ( row , to_seconds ( a . incremental_load_time ) . toFixed ( 3 ) ) ;
183
- if ( b ) {
182
+ td ( row , to_seconds ( cur . incremental_load_time ) . toFixed ( 3 ) ) ;
183
+ if ( prev ) {
184
184
td ( row ,
185
185
fmt_delta (
186
- to_seconds ( b . incremental_load_time ) ,
187
- to_seconds ( a . incremental_load_time ) ,
186
+ to_seconds ( prev . incremental_load_time ) ,
187
+ to_seconds ( cur . incremental_load_time ) ,
188
188
) ,
189
189
true ) ;
190
190
} else {
0 commit comments