@@ -200,11 +200,11 @@ jobs:
200200 thr_unit = ""
201201 }
202202 # Look for current throughput in "thrpt:" line before change section
203- /^ *thrpt: *\\ [/ && !in_change_section {
203+ /^ *thrpt: *\[/ && !in_change_section {
204204 # Extract the middle value from [lower middle upper]
205205 # Format: [34.030 Melem/s 34.345 Melem/s 34.641 Melem/s]
206206 # After split: [1]=34.030 [2]=Melem/s [3]=34.345 [4]=Melem/s [5]=34.641 [6]=Melem/s
207- match($0, /\\ [([^]]+)\ \]/, arr)
207+ match($0, /\[([^]]+)\]/, arr)
208208 split(arr[1], thrpts, " ")
209209 # Verify we have enough elements (at least 4 for value and unit)
210210 if (length(thrpts) >= 4) {
@@ -227,13 +227,31 @@ jobs:
227227
228228 # Verify we have at least 2 elements
229229 if (length(changes) >= 2) {
230- change_pct = changes[2]
230+ change_pct_str = changes[2]
231+ # Remove % sign and convert to number
232+ gsub(/%/, "", change_pct_str)
233+ time_change = change_pct_str + 0.0
234+
235+ # Convert time change to throughput change
236+ # If time decreased by X%, throughput increased by X/(1-X/100)%
237+ # If time increased by X%, throughput decreased by X/(1+X/100)%
238+ if (time_change < 0) {
239+ # Time decreased, throughput increased
240+ thrpt_change = (-time_change) / (1 + time_change/100)
241+ thrpt_change_str = sprintf("+%.2f%%", thrpt_change)
242+ } else if (time_change > 0) {
243+ # Time increased, throughput decreased
244+ thrpt_change = (-time_change) / (1 + time_change/100)
245+ thrpt_change_str = sprintf("%.2f%%", thrpt_change)
246+ } else {
247+ thrpt_change_str = "0.00%"
248+ }
231249
232250 if (current_thr != "" && thr_unit != "") {
233- current_change = sprintf("%s %s (%s)", current_thr, thr_unit, change_pct )
251+ current_change = sprintf("%s %s (%s)", current_thr, thr_unit, thrpt_change_str )
234252 } else {
235253 # Fallback to just percentage if we cannot parse throughput
236- current_change = change_pct
254+ current_change = thrpt_change_str
237255 }
238256 }
239257
0 commit comments