[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"nav-notes-count":3,"content-note-keeping-a-data-heavy-interface-responsive":4},9,{"id":5,"title":6,"author":7,"authorAvatar":8,"authorRole":9,"body":10,"category":408,"date":409,"description":174,"excerpt":410,"extension":411,"image":412,"index":413,"meta":414,"navigation":225,"path":428,"pullQuote":429,"readingTime":430,"seo":431,"slug":432,"stem":433,"takeaways":434,"total":438,"__hash__":439},"notes\u002Fnotes\u002Fkeeping-a-data-heavy-interface-responsive.md","Keeping a Data-Heavy Interface Responsive","Norbert Brett","\u002Fimages\u002Fnorbert-brett.jpg","Full-Stack & AI Systems Engineer",{"type":11,"value":12,"toc":401},"minimark",[13,18,36,63,98,112,119,123,126,168,245,254,382,397],[14,15,17],"h2",{"id":16},"why-standard-web-elements-freeze-under-heavy-data","Why Standard Web Elements Freeze Under Heavy Data",[19,20,21,22,26,27,31,32,35],"p",{},"To make a web application feel as smooth as a native desktop tool, the browser needs to draw ",[23,24,25],"strong",{},"60 frames per second (60 FPS)",". Simple division tells the whole story: ",[28,29,30],"code",{},"1,000 milliseconds ÷ 60 frames = 16.67 milliseconds per frame",". Once you subtract the browser's own housekeeping, your code has roughly ",[23,33,34],{},"10 milliseconds"," to finish its work before a user dragging a slider or scrolling a table feels a stutter.",[19,37,38,39,42,43,46,47,50,51,54,55,58,59,62],{},"In 2025, while building the ",[23,40,41],{},"Algorithm Engine","—an interactive visualizer for pathfinding (A*, Dijkstra, Bellman-Ford) and sorting algorithms—I wanted users to scrub through ",[23,44,45],{},"10,000 live connected nodes"," in real time. If you have ever tried to draw 10,000 separate ",[28,48,49],{},"\u003Cdiv>"," or ",[28,52,53],{},"\u003Csvg>"," elements in Vue or React and update them sixty times a second, you know what happens: the browser tab locks up completely, dropping to ",[28,56,57],{},"7 FPS"," (",[28,60,61],{},"138ms"," per frame).",[64,65,66,71],"blockquote",{},[19,67,68],{},[23,69,70],{},"In Plain English — Why Do Data-Heavy Dashboards Freeze?",[72,73,74,86,92],"ul",{},[75,76,77,80,81,85],"li",{},[23,78,79],{},"The Main Thread",": By default, a browser tab does almost everything on a single assembly line called the ",[82,83,84],"em",{},"Main Thread","—listening to your mouse clicks, scrolling the page, running JavaScript math, and painting pixels. If a heavy calculation hogs that assembly line for 100 milliseconds, buttons cannot even highlight when you hover over them.",[75,87,88,91],{},[23,89,90],{},"The DOM (Document Object Model)",": The browser's internal tree of HTML boxes, text, and buttons. It is designed for documents and forms, where it carefully calculates margins, borders, and screen-reader rules for every single box. Asking the DOM to recalculate layout for 10,000 moving dots every 16 milliseconds is like mailing 10,000 individually gift-wrapped boxes when you just needed to ship a pallet of gravel.",[75,93,94,97],{},[23,95,96],{},"Web Worker",": A separate background thread (like opening a second assembly line in the back room) that crunches heavy math without ever blocking the user's mouse or keyboard on the Main Thread.",[19,99,100,101,103,104,107,108,111],{},"My first fix was moving the pathfinding math into a background ",[23,102,96],{},". Yet when I profiled the app, I was annoyed to see the frame rate still dipping into the 30s. Why? Because every time the background worker sent an array of 10,000 JavaScript objects back to the main thread (",[28,105,106],{},"worker.postMessage(nodes)","), the browser spent ",[23,109,110],{},"9 milliseconds"," photocopying (\"cloning\") all 10,000 objects across threads and cleaning up the old copies in memory.",[19,113,114],{},[115,116],"img",{"alt":117,"src":118},"60FPS Web Worker + Transferable ArrayBuffer + Canvas 2D Architecture","\u002Fimages\u002Fnotes\u002Fdiagrams\u002Fkeeping-a-data-heavy-interface-responsive.svg",[14,120,122],{"id":121},"zero-copy-typed-arrays-and-html5-canvas-2d","Zero-Copy Typed Arrays and HTML5 Canvas 2D",[19,124,125],{},"You see, moving heavy work to a background thread only keeps the UI fast if handing the results back is nearly free. I solved this with two architectural changes:",[127,128,129,154],"ol",{},[75,130,131,142,143,146,147,58,150,153],{},[23,132,133,134,137,138,141],{},"Zero-Copy Transferable Buffers (",[28,135,136],{},"Uint32Array"," & ",[28,139,140],{},"Float32Array",")",": Instead of storing 10,000 separate JavaScript objects, we pack all node coordinates and states into a flat, contiguous block of numbers in memory (a ",[82,144,145],{},"Typed Array","). When the worker finishes a frame, instead of photocopying 10,000 objects, it transfers the memory key directly to the main thread in ",[23,148,149],{},"under 0.1 milliseconds",[28,151,152],{},"[frameBuffer.buffer]",").",[75,155,156,159,160,163,164,167],{},[23,157,158],{},"Hybrid Vue 3 + HTML5 Canvas 2D Rendering",": We let ",[23,161,162],{},"Vue 3"," manage the accessible buttons, speed sliders, and dropdowns in standard HTML, while all 10,000 graph nodes are painted onto a single ",[28,165,166],{},"\u003Ccanvas>"," bitmap surface—one element in the DOM instead of 10,000.",[169,170,175],"pre",{"className":171,"code":172,"language":173,"meta":174,"style":174},"language-ts shiki shiki-themes github-light github-dark","\u002F\u002F Inside the Web Worker: zero-copy ownership transfer back to the UI thread\nconst frameBuffer = new Uint32Array(nodeCount)\nstepDijkstraWavefront(graphTopology, frameBuffer)\n\n\u002F\u002F Transfers the raw memory pointer in \u003C0.1ms instead of cloning 10,000 objects\nself.postMessage({ tick, buffer: frameBuffer.buffer }, [frameBuffer.buffer])\n","ts","",[28,176,177,186,211,220,227,233],{"__ignoreMap":174},[178,179,182],"span",{"class":180,"line":181},"line",1,[178,183,185],{"class":184},"sJ8bj","\u002F\u002F Inside the Web Worker: zero-copy ownership transfer back to the UI thread\n",[178,187,189,193,197,200,203,207],{"class":180,"line":188},2,[178,190,192],{"class":191},"szBVR","const",[178,194,196],{"class":195},"sj4cs"," frameBuffer",[178,198,199],{"class":191}," =",[178,201,202],{"class":191}," new",[178,204,206],{"class":205},"sScJk"," Uint32Array",[178,208,210],{"class":209},"sVt8B","(nodeCount)\n",[178,212,214,217],{"class":180,"line":213},3,[178,215,216],{"class":205},"stepDijkstraWavefront",[178,218,219],{"class":209},"(graphTopology, frameBuffer)\n",[178,221,223],{"class":180,"line":222},4,[178,224,226],{"emptyLinePlaceholder":225},true,"\n",[178,228,230],{"class":180,"line":229},5,[178,231,232],{"class":184},"\u002F\u002F Transfers the raw memory pointer in \u003C0.1ms instead of cloning 10,000 objects\n",[178,234,236,239,242],{"class":180,"line":235},6,[178,237,238],{"class":209},"self.",[178,240,241],{"class":205},"postMessage",[178,243,244],{"class":209},"({ tick, buffer: frameBuffer.buffer }, [frameBuffer.buffer])\n",[246,247,249,250,253],"h3",{"id":248},"reproducible-benchmark-10000-concurrent-nodes-chrome-on-macos-m-series","Reproducible Benchmark (",[28,251,252],{},"10,000"," Concurrent Nodes, Chrome on macOS M-Series)",[255,256,257,280],"table",{},[258,259,260],"thead",{},[261,262,263,268,271,274,277],"tr",{},[264,265,267],"th",{"align":266},"left","Rendering & Threading Architecture",[264,269,270],{"align":266},"Frame Time (p95)",[264,272,273],{"align":266},"Main-Thread Blocking (TBT)",[264,275,276],{"align":266},"Sustained Frame Rate",[264,278,279],{"align":266},"Memory Garbage Churn",[281,282,283,312,343],"tbody",{},[261,284,285,291,296,301,307],{},[286,287,288],"td",{"align":266},[23,289,290],{},"1. Naive Main-Thread DOM \u002F SVG",[286,292,293],{"align":266},[28,294,295],{},"138.4 ms",[286,297,298],{"align":266},[28,299,300],{},"112.0 ms \u002F frame",[286,302,303,306],{"align":266},[28,304,305],{},"7–9 FPS"," (Frozen UI)",[286,308,309],{"align":266},[28,310,311],{},"~48 MB \u002F sec",[261,313,314,322,327,332,338],{},[286,315,316],{"align":266},[23,317,318,319,321],{},"2. Web Worker + Object ",[28,320,241],{}," + Canvas",[286,323,324],{"align":266},[28,325,326],{},"24.1 ms",[286,328,329],{"align":266},[28,330,331],{},"9.2 ms \u002F frame",[286,333,334,337],{"align":266},[28,335,336],{},"38–42 FPS"," (Stutters)",[286,339,340],{"align":266},[28,341,342],{},"~19 MB \u002F sec",[261,344,345,353,360,367,375],{},[286,346,347],{"align":266},[23,348,349,350,352],{},"3. Web Worker + Transferable ",[28,351,136],{}," + Canvas 2D",[286,354,355],{"align":266},[23,356,357],{},[28,358,359],{},"6.8 ms",[286,361,362],{"align":266},[23,363,364],{},[28,365,366],{},"0.0 ms",[286,368,369],{"align":266},[23,370,371,374],{},[28,372,373],{},"60 FPS"," (Locked)",[286,376,377],{"align":266},[23,378,379],{},[28,380,381],{},"\u003C0.5 MB \u002F sec",[19,383,384,385,388,389,392,393,396],{},"I used this exact same pattern months later on the dashboard for ",[23,386,387],{},"Kernel Telemetry",", where a ",[28,390,391],{},"\u003C15MB"," Go backend streams ",[23,394,395],{},"50,000+ Linux system events per second"," over WebSockets. A background worker ingests the incoming stream into a fixed-size circular ring buffer and hands 60Hz slices to the Canvas charts. I felt relieved watching our 4-hour soak test finish with flat memory usage and instant button responsiveness while 1,000 simulated servers hammered the feed.",[398,399,400],"style",{},"html pre.shiki code .sJ8bj, html code.shiki .sJ8bj{--shiki-default:#6A737D;--shiki-dark:#6A737D}html pre.shiki code .szBVR, html code.shiki .szBVR{--shiki-default:#D73A49;--shiki-dark:#F97583}html pre.shiki code .sj4cs, html code.shiki .sj4cs{--shiki-default:#005CC5;--shiki-dark:#79B8FF}html pre.shiki code .sScJk, html code.shiki .sScJk{--shiki-default:#6F42C1;--shiki-dark:#B392F0}html pre.shiki code .sVt8B, html code.shiki .sVt8B{--shiki-default:#24292E;--shiki-dark:#E1E4E8}html .default .shiki span {color: var(--shiki-default);background: var(--shiki-default-bg);font-style: var(--shiki-default-font-style);font-weight: var(--shiki-default-font-weight);text-decoration: var(--shiki-default-text-decoration);}html .shiki span {color: var(--shiki-default);background: var(--shiki-default-bg);font-style: var(--shiki-default-font-style);font-weight: var(--shiki-default-font-weight);text-decoration: var(--shiki-default-text-decoration);}html .dark .shiki span {color: var(--shiki-dark);background: var(--shiki-dark-bg);font-style: var(--shiki-dark-font-style);font-weight: var(--shiki-dark-font-weight);text-decoration: var(--shiki-dark-text-decoration);}html.dark .shiki span {color: var(--shiki-dark);background: var(--shiki-dark-bg);font-style: var(--shiki-dark-font-style);font-weight: var(--shiki-dark-font-weight);text-decoration: var(--shiki-dark-text-decoration);}",{"title":174,"searchDepth":188,"depth":188,"links":402},[403,404],{"id":16,"depth":188,"text":17},{"id":121,"depth":188,"text":122,"children":405},[406],{"id":248,"depth":213,"text":407},"Reproducible Benchmark (10,000 Concurrent Nodes, Chrome on macOS M-Series)","Motion Architecture","October 28, 2026",null,"md","\u002Fimages\u002Fnotes\u002Fkeeping-a-data-heavy-interface-responsive.webp","05",{"sections":415},[416,422],{"marker":417,"heading":418,"body":419},"\u002F A","Why DOM Diffing and JSON postMessage Stall at 60Hz",[420,421],"Every frame at 60fps gives you 16.67 milliseconds to handle input, run application logic, recalculate layout, and paint. In 2025, while building my Algorithm Engine and the live dashboard for Kernel Telemetry, I hit that ceiling immediately when rendering 10,000 graph nodes in standard DOM elements.","Even after moving A* and Dijkstra traversal into a Web Worker, calling postMessage with nested JavaScript objects burned 9ms per tick in structured-clone serialization alone.",{"marker":423,"heading":424,"body":425},"\u002F B","Zero-Copy Typed Arrays and Dirty-Rect Canvas 2D",[426,427],"Packing node coordinates and visitation states into flat Float32Array and Uint32Array buffers and transferring ownership across the worker boundary drops IPC overhead below 0.1 milliseconds.","Pairing that zero-copy worker pipeline with a single HTML5 Canvas 2D surface and ring-buffered telemetry streams keeps main-thread blocking at 0ms under 50,000+ events per second.","\u002Fnotes\u002Fkeeping-a-data-heavy-interface-responsive","React and Vue are brilliant at orchestrating UI controls, but asking the DOM to diff 10,000 SVG nodes sixty times a second is a physics problem, not a framework problem.","8 min read",{"title":6,"description":174},"keeping-a-data-heavy-interface-responsive","notes\u002Fkeeping-a-data-heavy-interface-responsive",[435,436,437],"At 60 frames per second, your browser has only 16.67ms per frame—heavy math on the main thread freezes buttons and scrolling.","Moving math into a Web Worker is only half the fix: use Transferable Typed Arrays (Uint32Array) to hand over data in \u003C0.1ms without copying.","Combine Vue\u002FReact for clean UI controls with HTML5 Canvas 2D for rendering thousands of live data points at a locked 60 FPS.","10","GBO3p1_pBqNiQfFMeVqt5w6ny5PWw7xHr_TGmzoUBJI"]