From 3c3bf5e4b5653e96f322004c64a1a104d941776a Mon Sep 17 00:00:00 2001 From: Jan Kiene Date: Thu, 5 Dec 2024 18:42:59 +0100 Subject: [PATCH 1/2] make stacked bar graphs work with the reference --- ci/complexity_measurements/genWebpageData.py | 6 + .../index_complexity.html | 107 +++++++++++++----- 2 files changed, 85 insertions(+), 28 deletions(-) diff --git a/ci/complexity_measurements/genWebpageData.py b/ci/complexity_measurements/genWebpageData.py index 457ca5ba93..447c5fd122 100644 --- a/ci/complexity_measurements/genWebpageData.py +++ b/ci/complexity_measurements/genWebpageData.py @@ -425,6 +425,12 @@ def create_display_strings( displays.append(display) + if which == "wmops_per_op": + assert len(displays) == 4 + # flot.js' "stack: true" depends on the order of data arrays + # reorder here instead of reworking above loop + displays = [displays[0], displays[2], displays[1], displays[3]] + return displays diff --git a/ci/complexity_measurements/index_complexity.html b/ci/complexity_measurements/index_complexity.html index daac766ca0..d1948e61c1 100755 --- a/ci/complexity_measurements/index_complexity.html +++ b/ci/complexity_measurements/index_complexity.html @@ -648,40 +648,91 @@ function WMOPS_perOP() { previousPoint = item.datapoint; $("#tooltip").remove(); - var encData = Graphs_WMOPS_perOP.wmops_worstcase_per_op.displays[0]; - var decData = Graphs_WMOPS_perOP.wmops_worstcase_per_op.displays[1]; + var encData, decData; + var encRefData, decRefData; + var text = ""; - var x = item.datapoint[0]; - var y = item.datapoint[1]; + if (Graphs_WMOPS_perOP.wmops_worstcase_per_op.displays.length == 2) { + encData = Graphs_WMOPS_perOP.wmops_worstcase_per_op.displays[0]; + decData = Graphs_WMOPS_perOP.wmops_worstcase_per_op.displays[1]; + + var x = item.datapoint[0]; + var y = item.datapoint[1]; + + var scoreEnc = Math.max(parseFloat(encData.data[x][1]), 0); + var scoreDec = Math.max(parseFloat(decData.data[x][1]), 0); + var scoreCodec = Math.round((scoreEnc + scoreDec) * 100) / 100; + + text += "Mode: " + Graphs_WMOPS_perOP.wmops_worstcase_per_op.runs[x].operatingPoint + "
"; + + text += 'Score: ' + Math.round(y * 100) / 100; + if (graph.direction == -1) + text += " WMOPS"; + if( item.series.id == "worstCaseEnc" ){ + text += " (enc)"; + } + if( item.series.id == "worstCaseDec" ){ + text += " (enc + dec)"; + } + text += "

"; + text += "Worst case enc: " + scoreEnc + " WMOPS
"; + text += "Worst case dec: " + scoreDec + " WMOPS
"; + text += "Worst case codec: " + scoreCodec + " WMOPS

"; + + var nEntriesWmopsGraph = Graphs_WMOPS.wmops_worstcase.runs.length - 1; + text += "Logfile
"; + } + else if (Graphs_WMOPS_perOP.wmops_worstcase_per_op.displays.length == 4) { + encData = Graphs_WMOPS_perOP.wmops_worstcase_per_op.displays[0]; + decData = Graphs_WMOPS_perOP.wmops_worstcase_per_op.displays[2]; - var scoreEnc = parseFloat(encData.data[x][1]); - var scoreDec = parseFloat(decData.data[x][1]); - var scoreCodec = Math.round((scoreEnc + scoreDec) * 100) / 100; + encRefData = Graphs_WMOPS_perOP.wmops_worstcase_per_op.displays[1]; + decRefData = Graphs_WMOPS_perOP.wmops_worstcase_per_op.displays[3]; - var text = ""; + var x = item.datapoint[0]; + var y = item.datapoint[1]; - text += "Mode: " + Graphs_WMOPS_perOP.wmops_worstcase_per_op.runs[x].operatingPoint + "
"; - - text += 'Score: ' + Math.round(y * 100) / 100; - if (graph.direction == -1) - text += " WMOPS"; - if( item.series.id == "worstCaseEnc" ){ - text += " (enc)"; - } - if( item.series.id == "worstCaseDec" ){ - text += " (enc + dec)"; - } - text += "

"; - - text += "Worst case enc: " + scoreEnc + " WMOPS
"; - text += "Worst case dec: " + scoreDec + " WMOPS
"; - text += "Worst case codec: " + scoreCodec + " WMOPS

"; + var run = Graphs_WMOPS_perOP.wmops_worstcase_per_op.runs[x]; + var codec = run.codec; + var op = run.operatingPoint; - var nEntriesWmopsGraph = Graphs_WMOPS.wmops_worstcase.runs.length - 1; - text += "Logfile
"; - + var scoreEnc, scoreDec; + + if (codec == "FLT REF") + { + x = (x - 1) / 2; + scoreEnc = Math.max(parseFloat(encRefData.data[x][1]), 0); + scoreDec = Math.max(parseFloat(decRefData.data[x][1]), 0); + } + else if (codec == "BASOP") { + x = x / 2; + scoreEnc = Math.max(parseFloat(encData.data[x][1]), 0); + scoreDec = Math.max(parseFloat(decData.data[x][1]), 0); + } + + var scoreCodec = Math.round((scoreEnc + scoreDec) * 100) / 100; + + text += "Mode: " + op + " - " + codec + "
"; + + text += 'Score: ' + Math.round(y * 100) / 100; + if (graph.direction == -1) + text += " WMOPS"; + if( item.series.id == "worstCaseEnc" ){ + text += " (enc)"; + } + if( item.series.id == "worstCaseDec" ){ + text += " (enc + dec)"; + } + text += "

"; + text += "Worst case enc: " + scoreEnc + " WMOPS
"; + text += "Worst case dec: " + scoreDec + " WMOPS
"; + text += "Worst case codec: " + scoreCodec + " WMOPS

"; + + var nEntriesWmopsGraph = Graphs_WMOPS.wmops_worstcase.runs.length - 1; + text += "Logfile
"; + } showToolTip(item.pageX, item.pageY, text); - + }); } -- GitLab From 7300368e0de4688ae31153c54c4cec9c88307ab7 Mon Sep 17 00:00:00 2001 From: Jan Kiene Date: Thu, 5 Dec 2024 18:54:52 +0100 Subject: [PATCH 2/2] fix scaling of bar graph y axis --- ci/complexity_measurements/index_complexity.html | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/ci/complexity_measurements/index_complexity.html b/ci/complexity_measurements/index_complexity.html index d1948e61c1..48e02c4f92 100755 --- a/ci/complexity_measurements/index_complexity.html +++ b/ci/complexity_measurements/index_complexity.html @@ -740,7 +740,19 @@ function WMOPS_perOP() { $(document).ready(function () { // need to get worst case of enc + dec combined, because values are stacked in the graph - var max = get_max_y_val_for_plotting(Graphs_WMOPS.wmops_worstcase.displays, 50); + var displays = Graphs_WMOPS_perOP.wmops_worstcase_per_op.displays; + var encData, decData; + if (displays.length == 2) { + encData = [displays[0]]; + decData = [displays[1]]; + } + else if (displays.length == 4) { + encData = [displays[0], displays[2]]; + decData = [displays[1], displays[3]]; + } + var max_enc = get_max_y_val_for_plotting(encData, 1); + var max_dec = get_max_y_val_for_plotting(decData, 1); + var max = Math.ceil( (max_enc + max_dec ) / 50) * 50; drawGraph($("#wmops_per_op-graph"), Graphs_WMOPS_perOP.wmops_worstcase_per_op, max); }); -- GitLab