From f62a5ebcf1e04af32ee872eb0203bf099d51d29d Mon Sep 17 00:00:00 2001 From: teobag Date: Mon, 10 Feb 2025 23:22:56 -0500 Subject: [PATCH] add asymmetry plot --- ACE/js/algorithms.js | 35 ++++++++++++---- ACE/js/workloadGenerator.js | 82 ++++++++++++++++++++++++++++++++++++- ACE/research.html | 66 ++++++++++++++++++++++++----- 3 files changed, 163 insertions(+), 20 deletions(-) diff --git a/ACE/js/algorithms.js b/ACE/js/algorithms.js index cb90c87..fb4f46c 100644 --- a/ACE/js/algorithms.js +++ b/ACE/js/algorithms.js @@ -982,16 +982,35 @@ function ACEDisplay() { const pagesEvictedDiff = calculatePercentageDifference(pagesEvicted, ACEpagesEvicted); const latencydiff = calculatePercentageDifference(tradLatency, aceLatencyval); - $("#ace-alg-buffer-misses").html(`${ACEbufferMiss} (${bufferMissDiff})`); - $("#ace-alg-buffer-hits").html(`${ACEbufferHit} (${bufferHitDiff})`); - $("#ace-alg-pages-read").html(`${ACEpagesRead} (${pagesReadDiff})`); - $("#ace-alg-pages-written").html(`${ACEpagesWritten} (${pagesWrittenDiff})`); - $("#ace-alg-read-IO").html(`${ACEreadIO} (${readIODiff})`); - $("#ace-alg-write-IO").html(`${ACEwriteIO} (${writeIODiff})`); - $("#ace-alg-pages-evicted").html(`${ACEpagesEvicted} (${pagesEvictedDiff})`); - $("#ace-alg-latency").html(`${aceLatencyval.toFixed(2)} (${latencydiff})`); + // ✅ Display the values with color-coded percentage differences + $("#ace-alg-buffer-misses").html(`${ACEbufferMiss}   ${formatDifference(bufferMissDiff, true)}`); + $("#ace-alg-buffer-hits").html(`${ACEbufferHit}   ${formatDifference(bufferHitDiff, false)}`); + $("#ace-alg-pages-read").html(`${ACEpagesRead}   ${formatDifference(pagesReadDiff, true)}`); + $("#ace-alg-pages-written").html(`${ACEpagesWritten}   ${formatDifference(pagesWrittenDiff, true)}`); + $("#ace-alg-read-IO").html(`${ACEreadIO}   ${formatDifference(readIODiff, true)}`); + $("#ace-alg-write-IO").html(`${ACEwriteIO}   ${formatDifference(writeIODiff, true)}`); + $("#ace-alg-pages-evicted").html(`${ACEpagesEvicted}   ${formatDifference(pagesEvictedDiff, true)}`); + $("#ace-alg-latency").html(`${aceLatencyval.toFixed(2)}   ${formatDifference(latencydiff, true)}`); } +function formatDifference(diffStr, isLowerBetter) { + if (diffStr === "0.00%") { + return `(--)`; // Show "--" for no difference + } + + let diffValue = parseFloat(diffStr); + let color; + + if (isLowerBetter) { + // Lower value is better → Green if negative, Red if positive + color = diffValue < 0 ? "green" : "red"; + } else { + // Higher value is better → Green if positive, Red if negative + color = diffValue > 0 ? "green" : "red"; + } + + return `(${diffStr})`; +} function baseLRU(p){ var type = workload[p][0]; diff --git a/ACE/js/workloadGenerator.js b/ACE/js/workloadGenerator.js index 8aabdfa..b92a869 100644 --- a/ACE/js/workloadGenerator.js +++ b/ACE/js/workloadGenerator.js @@ -171,6 +171,7 @@ $(document).ready(function(){ RWgraph(); // Now the RW plot updates only when the user clicks the button Bgraph(); // Buffer pool graph updates only when the user clicks the button + ACELRUgraph(); }); @@ -431,6 +432,9 @@ function RWgraph(){ RWData = [LRUtrace, ACELRUtrace, CFLRUtrace, ACECFLRUtrace, LRUWSRtrace, ACELRUWSRtrace]; Plotly.newPlot('RWplot', RWData, RWlayout); + document.getElementById("RWplot-caption").innerText = + "ACE improves runtime of write-heavy workloads."; + if(progress==23){ $("#loadingbar").empty(); } @@ -595,7 +599,8 @@ function Bgraph(){ }; console.log("graph"); Plotly.newPlot('Bplot', BData, Blayout); - + document.getElementById("Bplot-caption").innerText = + "ACE is beneficial across a wide range of bufferpool size "; $("#loadingbar").empty(); } @@ -605,6 +610,81 @@ function Bgraph(){ })(1); } + +function ACELRUgraph(){ + var b = parseInt($("#cmp_buffer_size_rw").val()); + var a = parseInt($("#cmp_kappa_rw").val()); + + var LRUx = []; + var LRUy = [[], [], [], []]; // Four SSD configurations + + var SSDConfigs = [ + [12.4, 3.0, 6], // PCI + [100, 1.5, 9], // SATA + [6.8, 1.1, 5], // Optane + [180, 2.0, 19] // Virtual + ]; + + (function myLoop(i) { + setTimeout(function() { + progress++; + LRUx.push(i); + + for (let j = 0; j < SSDConfigs.length; j++) { + let workloadStats = IOcalc(RWWorkload(i), b, a, 1); // Running ACE-LRU instead of LRU + let base_latency = 12.4; // TODO: needs to be fixed + let asymmetry = SSDConfigs[j][1]; + let write_latency = base_latency * asymmetry; + let latency = (workloadStats[2] * write_latency + workloadStats[3] * base_latency) / 1000; + LRUy[j].push(latency); + } + + update(progress); + + if (i < 100){ + i+=10; + myLoop(i); + } else { + let traces = SSDConfigs.map((config, index) => { + return { + x: LRUx, + y: LRUy[index], + mode: "scatter", + name: `${['PCI (α = 3.0)', 'SATA (α = 1.5)', 'Optane (α = 1.1)', 'Virtual (α = 2.0)'][index]}`, + marker: { size: 12, symbol: 'circle-open' } + }; + }); + + let layout = { + xaxis: { + autorange: true, + showgrid: false, + zeroline: false, + showline: true, + title: "Read Ratio (%)" + }, + yaxis: { + autorange: true, + showgrid: false, + zeroline: false, + showline: true, + title: "Latency (ms)" + }, + title: "ACE-LRU Latency" + }; + + Plotly.newPlot('LRUplot', traces, layout); + + document.getElementById("LRUplot-caption").innerText = + "Devices with higher asymmetry (α) have higher gain for ACE"; + + if(progress==23){ + $("#loadingbar").empty(); + } + } + }, 100); + })(0); +} //check if input values are too high function capacity() { var isComparative = $("#comparative-analysis").is(":visible"); diff --git a/ACE/research.html b/ACE/research.html index 4928c6b..f6b4381 100644 --- a/ACE/research.html +++ b/ACE/research.html @@ -366,7 +366,7 @@

0 - +
@@ -380,7 +380,7 @@

0

- +
@@ -394,7 +394,7 @@

0

- +
@@ -408,19 +408,21 @@

0

- + +
0
- #Write batches + #Write Batches
0
- + +
0 @@ -434,6 +436,7 @@

+
@@ -660,16 +663,57 @@
Vary Buffer Pool Size
- -
-
-
+ +
+
+ +
+
+

+
+
+
+

+
+
+ + +
+
+
+

+
+
+ +