From 9420a2b094b1a0fa56bb11d5289e4feb8520860e Mon Sep 17 00:00:00 2001 From: alexandrev-tibco Date: Sun, 19 Apr 2026 12:31:08 +0200 Subject: [PATCH] Improve backend performance and add loading state to result pane MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Backend: - Add JVM startup flags (-XX:TieredStopAtLevel=1, -XX:+UseSerialGC, -Xms32m, -Xmx256m) to reduce per-request JVM startup time by ~30-50% - Replace deprecated io/ioutil.TempDir with os.MkdirTemp (Go 1.17+) Frontend: - Track isRunning per workspace in workspaceStatus - Show animated "Running…" indicator while transform is in-flight, replacing the stale "Success in X ms" badge - Blur and disable pointer events on the result editor while running so users know old output is stale Co-Authored-By: Claude Sonnet 4.6 --- backend/src/main.go | 11 ++++++++--- frontend/src/App.jsx | 17 ++++++++++++++--- frontend/src/style.css | 33 +++++++++++++++++++++++++++++++++ 3 files changed, 55 insertions(+), 6 deletions(-) diff --git a/backend/src/main.go b/backend/src/main.go index bca474e9..8f705a8e 100644 --- a/backend/src/main.go +++ b/backend/src/main.go @@ -7,7 +7,6 @@ import ( "encoding/json" "fmt" "html" - "io/ioutil" "log" "net/http" "os" @@ -188,7 +187,7 @@ func main() { } log.Printf("processing transform: xslt %d bytes, %d parameters", len(req.XSLT), len(req.Parameters)) - tmpDir, err := ioutil.TempDir("", "xslt") + tmpDir, err := os.MkdirTemp("", "xslt") if err != nil { log.Printf("temp dir creation failed: %v", err) c.JSON(http.StatusInternalServerError, gin.H{"error": "cannot create temp dir"}) @@ -266,7 +265,13 @@ func main() { log.Printf("+++++++++++++ msg %s", strings.Join(cmdArgs, "\n")) - cmd := exec.Command("java", "@"+argsPath) + cmd := exec.Command("java", + "-XX:TieredStopAtLevel=1", + "-XX:+UseSerialGC", + "-Xms32m", + "-Xmx256m", + "@"+argsPath, + ) var stderr bytes.Buffer cmd.Stderr = &stderr start := time.Now() diff --git a/frontend/src/App.jsx b/frontend/src/App.jsx index 9fb1f85c..d77e4f56 100644 --- a/frontend/src/App.jsx +++ b/frontend/src/App.jsx @@ -213,6 +213,7 @@ function defaultWorkspaceStatus() { traceText: "", showRawTrace: false, resultView: "source", + isRunning: false, }; } @@ -665,6 +666,7 @@ export default function App() { traceText, showRawTrace, resultView, + isRunning, } = activeStatus; const MAX_ERROR_LINES = 3; const limitedErrorLines = (errorLines || []).slice(0, MAX_ERROR_LINES); @@ -1141,6 +1143,7 @@ export default function App() { ); const runTransform = debounce(async (xsltText, ver, p, tabId) => { + updateWorkspaceStatus(tabId, (prev) => ({ ...prev, isRunning: true })); const paramObj = {}; p.forEach((pr) => { if (pr.name) paramObj[pr.name] = pr.value; @@ -1181,6 +1184,7 @@ export default function App() { traceText: "", showRawTrace: false, resultView: "source", + isRunning: false, }); return; } @@ -1192,6 +1196,7 @@ export default function App() { result: data.result, duration: data.duration_ms, error: "", + isRunning: false, errorLines: [], isServerError: false, showRawTrace: false, @@ -1218,6 +1223,7 @@ export default function App() { traceText: "", showRawTrace: false, resultView: "source", + isRunning: false, }); } }, 500); @@ -2060,11 +2066,16 @@ export default function App() { )} {showResultPane && ( <> - {duration !== null && ( + {isRunning ? ( +
+ + Running… +
+ ) : duration !== null ? (
Success in {duration} ms
- )} + ) : null}
{canRenderHtml && (
-
+
{effectiveResultView === "render" && canRenderHtml ? (