From 35f37a64a95b2e0d47764e0da04bc5fb129ba714 Mon Sep 17 00:00:00 2001 From: qazal <77887910+Qazalin@users.noreply.github.com> Date: Thu, 4 Sep 2025 14:56:41 +0300 Subject: [PATCH] viz: remove useless ctx.save and restore calls (#11996) It's a UI no-op since we always set the styles right before drawing. --- tinygrad/viz/js/index.js | 2 -- 1 file changed, 2 deletions(-) diff --git a/tinygrad/viz/js/index.js b/tinygrad/viz/js/index.js index f317b5653a..7fcf28d41b 100644 --- a/tinygrad/viz/js/index.js +++ b/tinygrad/viz/js/index.js @@ -295,7 +295,6 @@ async function renderProfiler() { function render(transform) { zoomLevel = transform; rectLst.length = 0; - ctx.save(); ctx.clearRect(0, 0, canvas.clientWidth, canvas.clientHeight); // rescale to match current zoom const xscale = d3.scaleLinear().domain([0, dur]).range([0, canvas.clientWidth]); @@ -376,7 +375,6 @@ async function renderProfiler() { drawLine(ctx, [x, x], [0, canvas.clientHeight], { color:m.color }); ctx.fillText(m.name, x+2, 1); } - ctx.restore(); } function resize() {