Urgent.News

What's breaking now, across thousands of outlets.

Tech

Incremental Dependency-Graph Recalculation for 184 Excel Formulas in a Browser Web Worker

Spreadsheet UIs fail a simple latency test when built naively in JavaScript: the moment a user edits cell B4 in a 25,000-cell .xlsx model, evaluating every formula on the main thread drops frames and freezes keyboard navigation. When building Arte Sheets —a local-first browser spreadsheet supporting 184 Excel-compatible functions , dynamic arrays, Pivot Tables, and .xlsx / .ods / .csv / .tsv…

Spreadsheets struggle to maintain smooth performance when implemented directly in JavaScript. Editing a single cell in a massive spreadsheet triggers reevaluation of every formula on the main thread, causing frame drops and frozen keyboard navigation. To address this issue, Arte Sheets— a browser-based spreadsheet supporting 184 Excel-compatible functions, dynamic arrays, Pivot Tables, and various file import/export formats— moved formula evaluation and file conversion into separate Web Workers.

However, simply moving work off the main thread is not enough; the worker must still recompute all 10,000 formulas on every keystroke, leading to long queues of outdated worker messages.

The authors designed a hybrid incremental precedent-closure and dynamic-spill fallback engine to tackle this challenge within a mere 60 lines of worker coordination code. Problem 1: Textbook spreadsheet tutorials assume cell dependencies form a static Directed Acyclic Graph (DAG). However, real-world .xlsx workbooks break these static DAG assumptions in three ways: volatile and dynamic-reference functions, dynamic array spills, and structural mutations.

These complexities make it challenging to handle OFFSET and FILTER spills inside an incremental single-cell walker, as they can introduce stale-cache bugs. Conversely, falling back to full recalculation for every workbook makes simple financial sheets feel sluggish.

Problem 2: To efficiently split safe incremental edits from spill/volatile passes, the calculation worker classifies every formula cell during upsert using a fast regex check for volatile and dynamic-spill functions. These functions are tracked in an unsafe set alongside sheet spillOwners. When an edit message arrives from the UI coordinator, the worker decides in O(1) whether to execute a full topological pass or a targeted incremental closure.

The nextLayout variable contains information about the current workbook state, and needsFullPass checks if a full recalculation is required based on various conditions like workbook reset, workbook ID changes, layout differences, and unsafe set size.

Problem 3: For the common case where workbooks contain functions like SUM, XLOOKUP, INDEX/MATCH, SUMIFS, IFERROR, PMT, and standard arithmetic, needsFullPass remains false. Instead of evaluating dependents immediately as they are discovered (which risks reading half-updated intermediate cells in diamond dependencies), the authors first close the transitive dirty set across recorded range precedents before evaluation.

This ensures that chains of dependent cells see fresh values. The code iterates through a list of range points, checking each dependent formula's range against recorded precedents. If a hit is found, the calculation process continues with updated values.

Written by urgent.news from Dev.to's reporting — not their text. Machine-written — may contain errors; check the original before relying on it.

Read the original at dev.to →

More in Tech

Reviewing My nginx and Cloudflare Settings Cut Cloud Run Data Transfer Costs by 96%

In my previous post, [2026-11-03-1] , I reworked how I deploy to Cloud Run. This is a follow-up. As the title says, reviewing my nginx and Cloudflare settings cut my Cloud Run data transfer costs by…

  • Author reviewed Google Cloud bill to identify high data transfer costs.
  • Enabled gzip compression on nginx, reducing data transfer by 98%.
  • Set up Cloudflare caching rules for HTML and /index.xml files.

A Tale of Two Lists: The Recently Lost and the Long Gone

Every subscription business keeps two lists of former customers without meaning to. One list is short and warm: people who left in the last few weeks.

  • Recent former customers form a short, warm list requiring specific reactivation efforts.
  • Long list of all former customers is cold, serving as a source for winback campaigns.
  • Separate treatment of reactivation and winback maximizes effectiveness and avoids confusion.

How to keep lots of Excalidraw diagrams without losing them

I use Excalidraw for almost everything: system design notes, interview prep, sketches for blog posts. And every few weeks I see someone post that they lost months of drawings.

  • Save Excalidraw drawings as .excalidraw files manually through Excalidraw menu.
  • Export drawings as PNG or SVG files with Embed scene option on.
  • Use Excalidraw extension for VS Code or Obsidian plugin for versioning and backup.

How osFoundry's photo editor works with layers, retouching and composition on your own computer

It's Thursday afternoon and the photo for tomorrow's publication looks dull. The light was grey, the background is overcharged and the headline still needs to be put on top.

  • Photo Editor allows layer-based photo editing on desktop osFoundry application.
  • Users can adjust brightness, contrast, levels, curves, and more in Image › Adjustments.
  • Sam, freelance designer, edits PSD files using Photo Editor without altering originals.

More from Sunday 8 November →